The answer to 'how to prevent flea' is to take a comprehensive approach that includes treating your home, pets, and yard. Start by thoroughly vacuuming carpets, furniture, and other areas where fleas may hide, then dispose of the vacuum bag. Treat your pets with a veterinarian-recommended flea control product, and wash their bedding regularly. Treat your yard by applying an insecticide to kill flea eggs and larvae. Repeat these steps every 4-6 weeks to break the flea life cycle and prevent infestations.
If you continue to have issues with fleas, it's best to call a professional pest control technician who can assess the situation and provide more targeted treatment. They have access to stronger products and can identify the root cause to prevent the problem from recurring.