Lay your measuring tape or yardstick parallel to the top of the headboard to measure the width. Write down the measurement.
Lay your measuring tape or yardstick parallel to the side, and measure the height the same way. Write it down.
Measure the thickness of the board, and write this number next to the height and width. Add the thickness plus 1 or 2 inches to both the height and the width to account for the extra fabric needed to fold over and attach to the back of the headboard.
Take these dimensions to the store and buy a quantity of fabric as close to the dimensions as possible. Fabric usually can only be bought by the yard or half-yard, so you won’t be able to get the exact length you are looking for. Always round up to the next yard or half-yard to avoid coming up short on materials.