3 years is out of date by most standards. It should say on the tin. It does depend on when it was made though as most paint has a decent shelf life so it can be stored (on a shelf!) before it is sold and used. However, you might be ok so here on some tips so you can judge for yourself
What sort of paint is it?
I’m going to assume water based and single pack.
If it hasn’t been opened it is more likely to be ok. If it has been opened the fuller the tin the more likely it is to be ok.
Where has it been stored. If it has been exposed to high (>40C) or low (<5C) temps you are likely to have issues.
If it has skinned, peel the skin off and dispose, don’t try to mix back in.
Stick something in and give it a poke. You need to make sure you can mix it. There is likely to be some separation. Clear or thinner liquid on the top isn’t a problem (syneresis) as long as it is only a small fraction of the total depth. It will be a bit sludgy towards the bottom – if this mixes in then fine. If it doesn’t you are borked (soft vs. hard settling and dewetting).
Find something to paint (card, wood etc.) and do a test patch. Leave to dry. If it dries then that’s a good indicator. Give it a bit of a vigorous wipe to make sure its actually worked and isn’t just a colourful powder with no adhesion/cohesion.
If you are colour matching adjacent walls then consider a really tiny square to make sure that it hasn’t changed colour – either the paint in the tin or the paint on the walls.
If it’s only a small cosmetic area don’t worry too much.
If it’s solvent based much the same applies except it is probably a little more resilient to storage.