Keep the humidity and temperature of your room at moderate, constant levels. While the best range for the headboard will vary according to the type of pine, how dense it is and how much it dried out after it was cut, keeping the levels constant whatever they currently are will help keep the headboard from shrinking any more.
Search around the entire headboard for cracks in the headboard’s finish if it is lacquered. Devonshire Pine notes these cracks can let moisture in and out, causing the wood to swell or shrink. Sealing these up with wax is the recommended solution.
Use only pine that was well dried after the wood was cut, whether you are buying raw lumber to make your own headboard or are buying another pine headboard from a store. “Green wood,” or freshly cut wood, has a relatively high moisture content and is left to dry for awhile before anyone uses it to construct something. Wood that isn’t dry faces a greater risk of shrinking after construction, because dry air will suck out more moisture and have a greater effect on the remaining wood.