The first thing I wanted to do was to attach the bed to the headboard so that they were one solid unit. Because of the design of my Ikea bed and headboard they had plenty of surface area to attach to each other.
I used 4 3/8" bolts evenly spaced along the head board to hold the pieces together.
Clamp the headboard to the bed frame so it does not move. Drill holes the exact size as your bolts. Use large washers on either side of the bolt to prevent the bolt from damaging the wood and better dispersing the bolts holding power.
You may need an assistant for this step as it was difficult to be on both sides of my headboard at the same time.