For the XY plane, try cutting a square. Measure corner to corner diagonally. Compare the measurements. If they are the same, you're square. If not, you need to adjust your machine until they are.
To make sure the spindle is orthogonal to the table is a little harder. This is called "tramming". You can put a dial indicator on an extension bar, or use a flycutter or something similar in the spindle with something flat on the table, and revolve the tool by hand (don't turn on the spindle). Note where the point of the tool touches the flat plate,. If it touches evenly (or if the measurements from the dial indicator are all the same) then it's in tram. If not, decide whether it's out front-to-back or side-to-side (or both). It's usually easiest to adjust side-to-side by loosening bolts, moving the spindle mount, and retightening. If it's out front-to-back, you will probably need to put shims in on top or bottom of the mount until it's pointed straight up and down. An old feeler gauge set comes in handy for this.
If the rails aren't parallel, you'll notice that the gantry gets stuck. You can confirm this by measuring between them. Adjust them until it slides freely.