From a grocery store buying point the canned goods are the way to go.
But thanks to the internet buying freeze-dried and dehydrated foods is very simple and relatively affordable.
But there are other things you should think about too, like spices, honey and sauces and the list goes on.
Most anything powdered will last quite a long time.
The trick is to buy what you consume now so that you can rotate your stock on a regular basis and don't have to worry about out of date stuff till the SHTF.
Do not look past the little things we take for branded now like coffee, teas, paper towels, toilet paper and if you drink a few bottles of the stuff that you like.
This will make it so much better then just eating beans and rice.