Ok here we go, I'll try to explain how I did it but keep in mind I kinda just shot from the hip when I built these.
First you need a mental picture or physical picture of what you want. In my case I just Googled bunk beds and looked around at how other people did it. I just wanted an idea of what it should have. After I was done I sat down and stick figure drew out a design that I liked. Added ruff measurements and then went shopping.
For ours I knew a couple of things. First that we wanted to have 12" under the bottom bunk for storage and maybe a trundle bed later. Second that the measurements of the beds were about 37" by 74".
From there I worked out some measurements for the bunk.
All lumber was purchased in 8' lengths
38x75 inside measurements for the matress boxes. You'll need 6 2x6's for this. The cuts will be 4 41" pieces and 4 75" pieces.
70" for four corner posts. These are 2x 4's
8 mattress supports at 38" lengths, I used 2x4's.
6 roll out guards. Obviously we don't want the lil' ones rolling off the top bunk, so I used 2x4's for guard rails, I seen some use other things but I just kept it simple. For the top bunk you'll want to have a roll guard on either side and a roll guard at the head of the bed. The side guards are 75" lengths and the head guard is 41". For the bottom bunk you will want one for the head one on the side facing the wall and one at the foot of the bed ( that one doubles as a rung for the ladder). Again the side rail is 75" and the head and foot rails are 41"------ This equals 5 2x4's. The cuts will be 3 75" cuts, three 41" cuts.
You will be left over with one large piece that we'll use for a second rung in the ladder up the bed. Also a 41" cut.
You will definitely need 16 carriage bolts along with 16 washers and nuts. I used 5/16 bolts, at 3.5" lengths.
In total I believe I purchase 13 2x4's and 6 2x6's along with 16 bolts, my total was around 46 bucks at Lowes. Build time by myself about and hour, with help from the kids... maybe three hours. But worth it.
Cut Lumber to lengths desired. I already gave you my measurements but do what ever you want with yours, if you a 12" clearance from the floor like I did keep in mind that the child's mattress will keep them about 16 to 18 inches off the ground, that kinda hurts if they roll out. Plus if you have ceiling fans the top bunk will set a little closer to the ceiling and you may want to watch where you put the bed.
Assemble the mattress boxes. I did this first because it seemed to make since, plus this is my project. You want to have your two by sixes laid out with the 41" lengths on the outside and the 75's on the inside. I used nails this time but screws work better. I used 3.5" wood screws and pre drilled the holes the first time. I also counter sunk and used wooden studs to fill the holes. (not needed) 2 screws per corner is fine.
Sorry, I didn't have any good pics of the assembling of the beds. Obviously this is supposed to be a diagram looking straight down at the 2x6's, with the 1.75" side showing.
Attach the mattress boxes to the four corners. Use Screws at first to hold them in place while you drill out the holes for the carriage bolts. I put the 2x4's on the long side of the boxes but I believe that it would work fine on the ends of the bed too. ( also give more room for a trundle bed later). My first box went 12" up the corner posts, this is easy, measure 12" up on all four posts and that's where the bottom of the 1st bunk should go. I put the second bunk at 34" above the top of the first bunk, or 51.5" from the bottom of the corner posts. Mark the posts. Lay boxes on their side and position first two posts at the corners of the boxes. Attach with single screw to hold it steady and then drill out holes for carrage bolts, you need two for each corner of each box. Attach bolts tightly and then flip and repeat.
Step 4: Safety rails and ladder.
This is self explanatory. Add safety rail around the top and bottom bunk like I described above and an extra one at the foot for a ladder rung. Finish with the mattress supports. I used four screws per support.