Measure the dimensions underneath your loft to determine how tall your 4-by-4 desk legs should be and how wide your plywood desktop should be.
Purchase wood according to these dimensions. Purchase 2-by-8 boards that are as wide as the head and foot of the loft.
Stain or paint your lumber in a well-ventilated area and allow it to dry for 24 hours.
On the inside of each 4-by-4 leg, measure and draw a line 26 to 30 inches off of the floor, depending on how tall the desk will be. The supports for the desk will be attached at these lines.
Attach the 2-by-8 supports to each end of the bed using wood screws and a screwdriver. Make sure the screws are flush with the wood and cover them with wood putty if necessary.
Drill through the 4-by-4 boards at the marks you made. Attach the legs of your desk to the supports with bolts or screws. Make sure the screws are flush with the wood.
Place the plywood desktop across the supports. Use a level to make sure the legs and supports hold the desktop evenly. Attach the top of the desk with screws.