Align object to mimic imaginary line

How do I align an object with an imaginary Axis just by rotating ? I want the object to “Stay” in place but only just rotate to look directly at cursor. It should just be a simple pivot but I am having trouble looking for a tutorial for my situation

The End result should look like this. I did this by eye but I would prefer a more sophisticated method.

ImaginaryAxisPractice.blend (808.5 KB)

Just add an empty where the cursor is with a “Track to” object constraint.
I’ve done it here:
ImaginaryAxisPractice.blend (856.3 KB)
Or are you wanting to rotate it without it being an active track?

I suggest re-searching some piston rig tutorials… for example:

there is even something in the docs (and even in 2.81 since your file version…) : https://docs.blender.org/manual/en/2.81/physics/rigid_body/constraints/types/piston.html.