Converting Input.mousePosition to position on coordinate plane

So, I’m trying to set up some code where the user can click on the screen, and if the position where they clicked corresponds to the coordinates of a game object, that game object does something. I thought I could just use Input.mousePosition to do this, but it turns out that the mousePosition value is not representative of a value in the coordinate plane. Instead, the value represents a position in “pixel coordinates,” which means that, for instance, if I double the size of the game window, then clicking on the middle of the screen produces coordinates twice as large as the coordinates produced from a half-size game window.

How can I get a mouse position input that maps to the coordinate plane, or alternatively, what operation can I perform on the mousePosition variable to obtain a value in the coordinate plane?

The GUI (0,0) point is at the top left corner of the screen.

The mouse (0,0) coordinate is at the bottom left corner of the screen.

To get the coordinates of something that is ingame under your mouse, use something called raycast: Unity - Manual: Rays from the Camera