To prevent cockroaches, ensure that your home or business is sealed properly, including repairing cracks and gaps around windows, doors, and pipes. Keep food in airtight containers, clean up crumbs and spills promptly, and remove standing water. Regularly inspect your property to identify early signs of an infestation.