Pungent smells and unsanitary environments with unopened or decaying foods attract cockroaches most. They often go after meats, cheeses, grease, starch and sugary foods, and they are known to survive off of cardboard, leather, nylon clothing and other non-food items as well.
Cockroaches need moisture to survive, and they tend to condense in damp areas near leaky pipes or other stagnant water sources. Old and rotting foods attract roaches due to their strong odors, so throwing away full trash bags and sealing off access to garbage cans is advised. Maintaining a clean home, fixing leaky pipes and keeping foods sealed help prevent cockroach infestations.