If you are talking about a simple (straight) line, you can simply create two
Vector3, one called
startPosition which equals to the point that you clicked, and one called
endPosition which while holding your mouse it equals the mouse location, and then you release it, it keeps that last value. After that, how to draw the path is up to you. You can use a
LineRenderer with the above coordinates, or you can be more creative with a 3D mesh.
If you want to make something more complicated, like a line that has angles, you can still use
LineRenderer, just create multiple points, and each time you click the mouse (or any other input you like) create a new point on that position.
If you want curves, you can keep all the points like above, but you can also add control points (depending what kind of curve you want to make) and calculate their position based on their surrounding points, to make a smooth curve. If interested I'd suggest taking a look at Bezier Curves (Wikipedia). After you have the points (and their control points), there are some options how to draw them on the screen. I'd suggest taking a look at this tutorial.