Cockroaches are drawn to food, water and warm, hidden spaces, which means most prevention comes down to removing those three things wherever possible.
Sealed food storage matters more than it might seem. Cockroaches can access poorly sealed bags and boxes, so switching to airtight containers, including for pet food, removes an easy food source. The same goes for cleaning up crumbs and spills promptly, especially around stoves and countertops.
Water sources are just as important as food. A slow leak under a sink or a poorly draining area can be enough to sustain a small roach population even in an otherwise clean kitchen. Fixing leaks and drying damp areas removes that draw.
Clutter reduction, especially cardboard boxes and paper bags, eliminates hiding and egg-laying spots roaches favor. This is particularly useful in garages, pantries and storage rooms where clutter tends to accumulate.
When sanitation changes alone aren't enough, professional treatment that targets cracks, crevices and other hidden harborage areas tends to be more effective than surface spraying, since roaches often avoid treated open surfaces.