Is there a way to reverse cast my samsung tv screen onto my windows Computer

I’m a developer and I want to view my Samsung tv’s screen onto my pc. so that I can show the working code and the tv screen at the same place. How do I do this?