It depends on (1) the type of plant and (2) the storage conditions.
Different plants have seeds that last for different lengths of time. Onion seeds, for example, should be purchased fresh every year since the seeds are very perishable. Tomato seeds can last 4 years with decent storage practices. (Possibly longer if you do everything exactly right.)
Seeds don't like:
so you want to store them in a cool, dry, dark place. If "in a cupboard" is a warm, humid kitchen or garage cupboard, then I'd just toss the seeds, buy fresh, and use better storage in the future so that you don't have to buy fresh seeds every year.
If you have lots of seeds (e.g. a packet with dozens of spinach seeds), you can do a germination test to see if it's worth using them in your garden. However, this isn't really practical if you've only got half a dozen seeds of a particular plant.