How to precisely rotate an object so it is straight?

Hard to explain but, say I had a cube which was rotated on the y axis a tiny bit. I don’t know that amount though, so how would I rotate it back so it is perfectly straight on each axis? Doing R and then typing in amounts won’t work, and neither will holding control as that just increments.

If you rotated the object in object mode you can just clear the rotation with Alt+R

If you rotated the object in edit mode one way to clear the rotation is to use an empty as a helper object

thank you so much!