How do I rotate an object towards mouseclick?

I try to do it, but I do something wrong. I’m junior in this sphere, and yet I didn’t understand the connection between mouse click coordinates and current gameobject. PLEASE help me to solve the problem. Advance thank you …

		var mousePos = Input.mousePosition;
			mousePos.z = 100.0f; //The distance from the camera to the player object
			Vector3 lookPos  = Camera.main.ScreenToWorldPoint(mousePos);
			var gameobjPos = Camera.main.ScreenToWorldPoint(transform.position);

You could do

var mousePos = Camera.mainScreentoWorldPoint(Input.mousePosition);
mousePos.y = transform.y;

The second argument of LookAt defines the Up axis of the world, and it defaults to Y-axis, so change it accordingly.