Measure the width of the bed, chair or other item you're building slats for where the slats are to be placed.
Purchase 1-by-4 inch boards and cut them 1/2 inch shorter than the width measurement to allow them to fit in the frame or between the supporting boards. Take the measurements with you to the lumber yard. Many will cut the wood for you, saving you the hassle.
Sand the boards down with fine-grit sandpaper to eliminate splinters.
Place the boards in place to support your item of furniture. Space them evenly apart to provide adequate support.