Script that makes an object rotate on the z axis by following the mouse's position on y axis?

I need help making a script that makes an object rotate on the z axis by following the mouse’s position on y axis.

Take the delta from where the mouse is to where the rotating GameObject is, and use Mathf.Atan2() to get the angle in radians, then use Mathf.Rad2Deg to convert it to degrees and set the rotation of the rotating GameObject.