How can i rotate a GameObject to face the mouse cursor?

I’ve been trying to make my GameObject to face the mouse cursor by rotating the whole thing. I have watched a video where the guy used this code:

But when i use this code my character/GameObject my whole camera rotates in a very high speed and keeps speeding after the slightest flick of the cursor. I think this is because i’ve tried to make the camera follow the GameObject also with Cinemachine 2d.
My question is then. Do this mean i have to write something else in the code instead of Camera.main.ScreenToWorldPoint? Or is it an qeustion of the speed of rotation? Or something totally different?