if you search this Forum you can find a lot of helpful code and links.
Here is the ImageJ User Guide and here are the documents for macro coding:
These links have been posted a hundred times before …
Here is an ImageJ-macro that does what you want:
requires( "1.52k" );
waitForUser("Set start and end point.\nThen click OK.");
makeLine(x, y, x, y);
run("Overlay Options...", "stroke=gray width=3 apply");
Paste the above macro code to an empty macro window (Plugins >> New >> Macro) and run it.
You may change the color and width of the line by changing the entries in the code line:
run("Overlay Options...", "stroke=white width=3 apply");
The line is drawn as an overlay, i.e. it can be hidden or deleted or burned to the image (flattened).