All plants will produce seeds. Identifying the part of the plant that contains the seed is usually elementary, but varies by plant. Look for the seed in or near the flower. For flowers that turn into edible fruit, (like tomatoes, peppers, squash, tree fruit, peas, beans), look for the seed inside the fruit. For plants that offer up another part to eat, (like roots, stems, leaves), look for the seed to develop in the flower itself; carrots, beets, radishes, celery, rhubarb, chard, spinach, lettuce, and kale all produce seeds in their flowers. Ornamental perennials usually produce seeds in flowers too.
Though some seeds are the goal of the harvest, like peas and beans, they are not suitable for saving and sowing in their young, edible phase. These are actually dry seeds from a collecting perspective. For them to be fully formed and ready for sowing, they should be left on the plant until the pod dries out and the seed begins to dry.
While wet seeds are gathered wet, the key to dry seeds is that they dry on the plant and remain dry until sowing later. If sustained rain, snow, or fog threatens when it's time to collect seeds, it's better to gather them while dry, or in a stage of drying, than to run the risk of mold and rot setting in. Dry seeds can be damaged or ruined if moisture permeates them at maturity.
Collecting seeds isn't much different than harvesting fruit and vegetables. I enter my garden with a paper bag already marked with the type of seed I'm collecting. Then I snip, pluck, or break off the seed cluster into the bag. I focus on one plant and try to harvest all of the seeds before moving on to another.
Seeds that develop in clusters from little flowers are slightly more effort. Cutting off the entire cluster is usually the easiest way. Dill, parsnip, and cilantro produce little umbrellas of seeds that are easy to cut off. Spinach, basil, and thyme produce little seeds along the stem and are easiest to gather by cutting off that part of the plant. Onions and leeks produce globes of seeds and the entire ball can be cut off.
Most of these fruits will change color as a sign that the seeds are ready to harvest; they will no longer be green. Tomatoes will be a deep red (or orange, yellow, or purple depending on the type). Peppers will turn red. Pumpkins will turn orange. Cucumbers will turn orange. Eggplant will be a deep purple (or white). The point is that when the fruit reaches its zenith of color, it's usually the right time to collect seeds. Often the fruit loses its best flavor and texture at the same time.
At that point cut open the fruit and scoop out the seeds to remove them from the fruit. The seeds will usually need to be scrubbed, rinsed, or fermented to completely separate them from the pulp. You want to get individual seeds that can be dried and saved.
Collecting seeds involves just a few steps. Let the plant produce seeds, allow the seeds to mature, remove the seed and its covering from the plant, then separate the seed from its covering. Most of the work is done by the plant while you wait and do other gardening chores. When the process is complete you're left with seeds ready to sow the next season or share with fellow gardeners. A saved or shared seed has a definable history that you may not discover in anonymous seed from a retail package.
Knowing where my seed comes from and being part of the process brings me even more in touch with the plants I grow. For an avid gardener, collecting seeds is as much a part of the gardening experience as amending soil with my own compost, using reclaimed organic mulch, practicing integrated pest management, or any of the many other beneficial garden practices available.