When the flower is ready to harvest (when flower petals begin to dry out and fall off), cut the head off and hang somewhere to dry (where the birds won't get them, or cover with a bag - you can always leave some out for the birds later).
When the head has dried rub the seeds off with your hands over a container then leave the seeds to dry further for a few days in a tray (or a cardboard box for example) before storing in an airtight container.
Label and store your container ready for Spring next year.