Converting iPhone touch to world coordinates

Hello! I know this is super simple stuff, but I’ve been digging for over an hour now and can’t figure out how to turn screen touch coordinates into world coordinates. Specifically, I want to detect when the user taps a specific enemy so that enemy can then die, kinda like whack-a-mole. I know it involves RayCasts but I’m kind of having trouble comprehending what those are, and what all of its function parameters do. I’ve been staring at the Unity documentation for a while, pretty confused over here! Sorry this is question is so dumb but any help, guidance, advice would be super appreciated. Thanks <3 <3 <3

Ok so a Raycast is what you want. A raycast is a line drawn through the scene from some point, in some direction for some distance. Depending on which function you call that will either return the first thing that is hit, all of the things etc etc.

Your camera is a point in the scene (the view on the screen is what can be seen from that point with the current camera settings).

To make the direction of the line for touching it uses the point which is the camera and the point which represents the finger - those two points make a line which represents the direction from the camera through the scene. Fortunately the camera does the heavy lifting and can covert a screen position to a Ray for you.

So presuming you want to use your currently active main camera:

     RaycastHit hit;
     //Get the camera to make the ray
     var ray = Camera.main.ScreenPointToRay(Input.touches[0].position);
     //Check if the ray hit something and return the info
     if(Physics.Raycast(ray,  out hit))
     {
          //Use hit.collider.gameObject to get the gameObject hit
          //Use hit.collider.GetComponent<Something>();
     }