Buying food is not a sin, since it is necessary to eat. Someone has to do the work of preparing the food (be it you or someone else), so the work is necessary. Some may say that you could make the food on Saturday and put it in the fridge, but this above and beyond natural means, so it is not considered a sin to not do this (of course, they couldn’t just put Sunday’s meals in the fridge on Saturday when the Commandments were given by God). As far as shopping on Sunday, that IS unnecessary work both on your part and on the part of the store. Those working in the store are doing unnecessary work (as it is not necessary to sell on Sunday–and the Church especially forbids doing business on Sunday, even if it is not servile work). You are not only supporting them in committing the mortal sin of unnecessary work on Sunday by shopping, but you also commit the sin of unnecessary work by performing the act of shopping. Mostly everything that people do nowadays on Sunday is unnecessary work. Take, for example, how people do not even think in turning on the TV on Sunday. But in order for the TV to operate, it is necessary for people to be working. For example, football–the broadcasters are on there, doing their job, which is completely unnecessary. Many Catholics turn on the TV and watch nonetheless. And just about any programming does likewise. Even cartoons have to have someone at the TV station monitoring all of the programs to make sure they run properly. How lukewarm Catholics are today and brush this off as if it does not concern them!
To answer a certain objection that often comes up (but is very illogical), people will say: well, Priests work on Sunday! It must be OK. That is ridiculous. Mass on Sunday is a necessary work. And also doing the corporal works of mercy, these are necessary works. They can be done on Sunday. It is lawful to help the elderly in their homes, of course. Otherwise, they would not be able to function. One must use common sense in this matter. What is unnecessary always, however, is someone who is working in order to help someone else simply do recreation (e.g. broadcasters, video rental stores, any retail store, etc.).
God bless