How do I take the mouse's moving position and convert it to world position?

Just when I click on the left button, it sets the sphere collision under the mouse cursor. All I want is for it to do this in the same way without clicking. I did it as you showed in the image, but it didn’t work, did I miss something?