Some types of seeds keep for a very long time, some seeds will lose viability in a year or two. Nearly all seeds will keep for a year or two if stored properly. Store them in an airtight container, and keep them as dry as possible. Use of a desiccant is recommend for long-term storage. If you intend to buy seeds and use them in the same year, no special storage is needed.
Another point is that the seeds don’t all die at once. Even after several years, you will still probably see germination rates of 50% or more in some cases. You can just plant more in that case, with the expectation that not every seed you plant will germinate.