Whether you eat near your PC or not, there's still a chance that you'll find ants making a home out of it. They are likely attracted to the warmth inside, and it does not bode well for you since they might chew on wiring, and it will damage your PC. If you have that problem now, here's what you should do.
1. Turn Off Your PC
The very first thing you have to do is shut down your PC and then unplug it from the power source. This will prevent any further damage, and you'll be able to avoid getting electrocuted as you attempt to clean it out. Wait for it to cool off when you've been using it for a while.
2. Remove the Components (Optional)
If you know your way around your computer and can re-assemble it, you will have an easier time cleaning it out if you remove the individual components. This way, you'll be able to closely inspect each one and clean them out without the restriction of a small boxed space.
3. Remove the Ants
Inspect every crevice and corner of your PC and look for the ants. Once you do, try to wipe them away with a dry cloth first if there are a lot. If you only find a small number of them, you could do with using a blower or a can of compressed air to remove them.
4. Find What's Attracting Them
Removing them won't be enough if there's something they will want to come back to. Look for things like crumbs or spills from flavored drinks and clean them off. It will not be limited to food. There's a chance that they are also attracted by other dead insects or even animals like lizards.
5. Wipe Down Your PC
Aside from the potential source that's attracting the ants, you should also wipe down your PC to remove any pheromone trails they might come back to. In case you don't know, ants leave odors that others can find and follow. You can effectively remove this by using electronics-safe chemicals.
6. Look for Entry Points
PCs and PC cases are built to provide good ventilation, which means there will be a lot of entry points. You can't exactly close them all off since your PC might overheat. Instead, you can place ant repellents where they would likely pass through, or ant traps at the bottom of your PC.
7. Wipe the Surfaces Near Your PC
What's attracting the ants might not be the PC or inside the PC itself. They might be sensing other food sources near your computer and end up finding shelter inside your PC. Wipe the surfaces near your unit to be sure. This will get rid of the linking pheromone trails as well.
8. Purchase a Food Tray
If you cannot help but eat at your PC station, you should get yourself a tray where you can place your food. That way, the spills will be limited to the tray instead of your workstation, and it would be much easier to clean.