Like other species of ants, Tapinoma melanocephalum forages meaning the workers collect food and bring the particles back to the nest (to see this in action click here). Adult ants are unable to eat the larger particles of food because their esophagus is very narrow and therefore only allows liquid and very small food particles to pass through. The larvae, on the other hand, have sharp teeth that enable them to chew up the solid foods that are brought to the nest by the adult ants. Unlike other animals that we usually think of the mother regurgitating food to feed her young (a common example is the bald eagle), ants do the reverse.  As said on "[A]dults often obtain partially digested, liquid food, regurgitated to them by the larvae" (Murry & Sciurrum, 2009).
The diet of Tapinoma melanocephalum is dependent on its habitat. If the ants are in a building and interacting with humans, their role consists primarily of being a pest since they do not sting or bite. The ghost ant will search mainly for sweets and protein rich foods while living inside homes, hospitals, etc. In outdoor habitats the ghost ant has a much wider range of food sources and predation is a prevalent role. Ghost ants will feed on other pest species as well as disease spreading species by either scavenging for dead insects or eating the eggs and larvae of the other organism (Espadaler et al, 2002). To find out about the specific organisms treated as prey, check out the interactions page.