To make an upholstered headboard, affix foam to plywood of the appropriate size, and attach upholstery fabric and batting to the foam-side of the plywood. Attach wooden boards to form the two supporting legs of the headboard, and cover the protruding boards with fabric. Affix nailhead trim to the headboard, and attach the latter to the bed frame.
After cutting plywood to the required size, cut a 1/2-inch thick foam so that it is 1 inch smaller than the plywood on all sides using regular scissors or a power knife. Apply hot glue on the foam's corners or spray a suitable adhesive on it to adhere the foam to the plywood.
Then, cut a suitable upholstery fabric and batting to a size slightly bigger than the plywood on all sides. Spread the fabric on a flat surface so that its wrong side faces upwards. Place batting over the fabric, and position the plywood with its foam-side facing downwards on the batting.
Bring the edges of the fabric and batting over the plywood's edges, and staple the layers to the wood. Stretch the layers taut when stapling.
To form the supporting leg of the headboard, position a 1-by-8-by-20-inches wooden board over another piece measuring 1-by-8-by-58 inches such that one of their shorter sides are aligned. Screw the two wooden boards together using two screws each on the bottom and top sides. Build the other supporting leg in a similar manner.
Affix the legs to the headboard using wood screws so that the shorter board protrudes out. Staple fabric on the protruding legs. Drill holes at 2-inch intervals along the edges of the headboard using a 1/16-inch drill bit, and affix the nailhead trim using a rubber mallet.