Getting the Mouse pos in 3D World

How can I go about getting the position of the mouse in a 3D world like if you were to click to walk to a tile or position, getting the x and y of the mouse click in the map.