Tilt your headboard against a wall in an upright position.
Slip the metal extensions of one rail into the slots on the headboard. Tilt the end of the rail that you're attaching up to align the extensions with the slots on the headboard. Lift the rail itself to lower the extensions into their slots.
Slip the other end of the same rail into the slots on the corresponding side of the footboard. Use the same technique that you used on the headboard.
Attach the other rail in the same manner.
Tilt the headboard against the wall. Align the holes in the end of one rail's bracket with the holes in one side of the headboard.
Align the screws with the holes in the bracket one at a time, then screw each one in place. Do not completely tighten the screw yet.
Align the holes in the bracket on the other end of the rail with the holes in the footboard.
Place a screw into each hole one at a time and tighten the screws into place. Do not tighten them completely.
Connect the other rail on the opposite side of the bed in the same manner.
Tighten all of the screws once both rails have been attached and the headboard and footboard are aligned.