Remove all mattresses, bedding and box springs. Remove any trace of the old bed leg by unscrewing any brackets or mounting apparatus that helped attach the leg to the bed. Save any pieces of the leg mounting assembly that may be helpful when reinstalling a new bed leg.
Measure the height of the original IKEA bed legs, or simply pick a height if you are building all new legs for the bed. Transfer the measurements to the 2-by-4 board, and cut out the required length of wood. Repeat this process for all four legs if necessary.
Position the new leg in place underneath the bed frame in the old leg location. Predrill two holes through the bed frame and into the bed leg. Attach the bed leg to the bed frame with wood screws. Reposition the box spring, mattress pad and blankets. Test the new leg thoroughly before sleeping in the bed.