Cut a 1 x 4 the length you want it to be - we usually cut ours about 3 ft long.
Next cut down the center - we call that ripping the board - except instead of cutting it straight we turn the saw on a 45 degree angle as shown in the illustration.
Next, pre-drill holes (through the center of the thickest parts of your boards) about every 8 inches.
Using a level, screw the thick side of one piece to your Upholstered Headboard or Legless Table and with the angle pointing down. (This creates a small channel between the thin angle and the headboard).
Find your studs - this is a must - you gotta hit a stud on at least 2 holes. The more the better.
Then install one screw into the thick side of your remaining board to the wall (into a stud) with the angle pointing up. (this creates a space between the thin angle of your board and the wall. Use a level and make sure the board is perfectly level. After doing so, install the rest of the screws.
We apply little spacer blocks from the left over 1 x 4 at both bottom corners of the headboard to keep it from tilting.
The boards are really inexpensive BUT - if you don't have access to a saw or don't feel comfortable using power tools you can cheat. I sometimes use a couple of the Rubbermaid FastTrack Shelving Rails.
These are sometimes hard to find because they have changed the design over the years. They have to look exactly like this so that they hold your piece really close to the wall
Your local hardware stores should stills stock them.
That's it !!!