I use a rafter square or marking square with my crosscut sled. The rear fence must be straight of course.
I take one side of the piece that I will be using and abut it to the rafter guide at 90 degrees, this will raise an edge away from the rear fence. I clamp it down allowing the minimum over the kerf line of the sled and cut. Make a mark for reference, this is now true edge, now do the same procedure for one more side you now have 1 horizontal and 1 vertical side, mark it. You now have two reference sides to place against the rear fence for remaining cuts. All sides will be square.
A hold down is very important for the first reference cuts, the slightest movement will negate the intent.
It is easier to do than to verbally describe.
-- honing my craft one mistake at a time.