Measure the width of the bed then subtract 6 inches from this figure to account for the size of the posts. Note this measurement on a piece of paper. Decide how high you want the headboard to reach and note this length on your paper. Determine how high the footboard should be and write this figure down as well.
Cut four lengths of 2x4 to the height of the headboard with a circular saw then cut four lengths of 2x4 to the height of the footboard. Measure and cut two sheets of 1-inch-thick MDF to the width you noted in Step 1. The height of the MDF sheets should be equal to the height for the headboard and footboard less 6 inches.
Glue the short edges of the MDF footboard sheet. Stick one of the footboard's 2x4 pieces to the sheet so the MDF is attached to the center of one of the sides of the 2x4 pieces. Counter-sink long screws into the MDF then the 2x4 to reinforce the joints. Glue the other footboard 2x4 piece to the screwed pieces to cover the screws and make strong footboard posts. Repeat this process with the headboard pieces.