I find the easiest method is to use “dx & dy” at the very bottom, middle, of your screen, below the workspace.
Using your above example,
place your cursor at the origin,
press the space bar which will set dx &dy to Zero,
move your cursor to the diagonally opposite corner of your red box
highlight that corner,
Drag your box in the X or Y or both planes while watching “dx & dy”.