Seed that is available in hardware stores and nurseries came from somewhere. Plants just like those that such seed grows into produced it. Someone, or many someones, collected all that seed to make it available to others. Similarly, several plants in our own gardens produce seed. Anyone who is interested in collecting seed to grow more of the same plants could make good use of it.
After bloom, most flowers deteriorate and disappear into the landscape. Some leave behind desirable developing fruits or vegetables. Many of the flashiest flowers are too extensively hybridized to produce seed. Many produce some sort of seed structure that typically gets removed, or ‘deadheaded’. This diverts resources from seed production to subsequent bloom or vegetative growth.
If not removed, such seed structures can mature to produce viable seed. Those who enjoy collecting seed often intentionally leave a few seed structures for that purpose, instead of deadheading completely. For plants with long bloom seasons, this technique should involve the latest blooms. The same applies to vegetables that normally do not mature prior to harvest, like summer squash.
Such seed or fruiting structures, including vegetables, must be completely mature before collecting ripened seed from them.
Sunflower, cosmos, calendula, marigold, campion, morning glory, columbine, hollyhock and snapdragon are some of the easiest flowers for collecting seed from. California poppy, alyssum, phlox, and several other annuals are happy to self sow their seed, although collecting seed from them is not so easy. Nasturtium and honesty (money plant) seed is easy to collect, but self sows as well.
Collecting seed is limited only by practicality. Some plants, particularly hybrids and exotics (which are not native and may lack pollinators), produce no viable seed. Extensively bred varieties are likely to produce progeny that are more similar to the basic species than the parent. Once collected, some seed need special treatment in order to germinate. All seed should be sown in season.