Measure the thickness of the foam across the front of the headboard. Choose studs long enough to pierce the fabric and enter the wood base but short enough that the fabric will balloon slightly around the head of the tack once secured. Choose a color, style and design that fits into the theme of the frame and room decor.
Measure and mark the line or pattern in which you want the studs applied. If you only have or want to use a few tacks, space them in across the front of the headboard. If you have or want to use many tacks, create a line around the edge of the headboard. Space the studs evenly regardless of the chosen pattern, as uneven spacing will be noticeable when finished. Put a pin in each stud location.
Hold a stud up to one of the pin marks, remove the pin and place the stud against the headboard. Hammer the studs through the batting and into the wood backing with a rubber mallet.