Measure the distance from the floor to the top of the upper bunk's frame.
Cut two 2-by-4 boards to match your measurement. These will be the ladder's rails.
Remove the mattresses from both beds and set them aside.
Stand the rails on the ground, positioned 14 inches apart. Clamp them in place against the frames of the upper bed and lower bed, with the flat sides of the rails against the frames.
Drill a 1/2-inch hole through each of the four riser-frame joints.
Pass a 3/8-inch carriage bolt through the front of each hole and tighten a nut on it from the backside of the bed frame. The length of the bolts is determined by the thickness of the bed frame.
Cut four 21-inch pieces of 2-by-4. These will be the ladder's rungs.
Clamp the rungs onto the back of the rails, spacing them out evenly between the upper and lower bed frames. The lower bed frame will be the ladder's first step. Use a level to ensure that all rungs are perfectly horizontal.
Drill two 1/16-inch pilot holes into the back of each rung where it connects to the rail. The pilot holes should go into the rails, but be careful not to drill all the way through.
Screw the rungs to the rails using 2 1/2-inch wood screws, screwed into the pilot holes.
Sand the ladder with an electric sander to remove any splinters or burrs. Use the sander to round any sharp edges or corners at the top of the ladder.
Paint or stain the ladder if desired.