If you’re constructing your own bed, you may prefer to avoid including a box spring and install slats instead. They must be strong enough to support a mattress without sagging, and they should be narrow. That increases the number of gaps between them and allows the mattress to breathe.
While virtually any lumber would work for bed slats — provided all the slats are the same thickness — you’re overdoing it by using anything thicker than 1 inch. Thinner boards make the frame less cumbersome and are easy to remove and store should you need to disassemble the frame and move it. Pine or fir boards that are 3 or 4 inches wide are a good choice. They are strong enough to support your weight and are usually inexpensive.
It isn’t a good idea to install the slats flush against one another, because that could allow moisture to collect underneath the mattress, and the result would be fabric deterioration and mold. On the other hand, excessively wide spacing allows the mattress to sag, and you’ll feel that when you’re sleeping. A gap of about 1 1/2 to 2 inches between slats is the happy medium that allows the mattress to breathe while providing enough support to keep you comfortable.