Quote (from the RHS's advice for young gardeners):
"Leave the flower head on the stem for at least 2 weeks. Once the petals have faded, cut the flower heads off and store them in a sunny, warm, dry place for another week. Spread a sheet of newspaper on a flat surface, gently rub the seed head and the seeds will fall away easily.
Collect them in an envelope or paper bag and store in a dry, cool, dark place until spring when they will be ready to sow and grow once more."
https://schoolgardening.rhs.org.uk/Resources/Info-Sheet/Sunflower-growing