Mark your best plants while they are blooming and save those seeds. The best plants produce the best seeds.
Seeds must ripen fully on the plant before you harvest them. (Bean and pea pods, for example, turn brown and dry.)
Keep a few seeds back, in the spring-time, so you have a standard against which you can compare your fall seeds. Compare colour, size, and especially plumpness.
Look for insect damage – sometimes just pinpoint holes in the seed where critters have burrowed in – and discard affected seeds.
Choose seeds from many plants to maintain the natural diversity of their traits. For example, if your beans have a natural variation in colour, save some seeds of each colour to preserve the assortment.
If you want to breed a new strain, collect seeds from the plants you like best.