Measure the width of the bed. Write this measurement down in inches.
Take another measurement of the width about a foot higher and a foot lower than the original spot to verify the bed is a consistent width. If you get a different measurement, write the number down.
Buy 1-by-4-inch boards from the lumberyard in a sturdy type of wood capable of holding a person's weight. For a twin bunk bed, use three slats for each bed for a total of six slats. Take the measurements to the lumberyard with you. Many times someone there will cut the wood for you. If not, measure and cut it yourself.
Sand the edges of the slats with a fine-grit sandpaper to eliminate the risk of splinters.
Place one slat 18 inches from the top of the bed, another slat 18 inches from the bottom and the third in the middle. Assuming the bunk bed is a twin bed measuring 75 inches long, place the third slat approximately 32 inches from both the top and bottom.