The answer to 'how to prevent flea' is to take a comprehensive approach to flea prevention. This includes treating your pets, your home, and your yard to eliminate existing fleas and prevent future infestations.
Start by treating your pets with a veterinarian-approved flea control product, such as a topical treatment or oral medication. This will kill any existing fleas on your pets and help prevent future infestations. Vacuum and wash your pet's bedding regularly to remove any eggs or larvae. In your home, thoroughly vacuum and steam clean carpets, upholstery, and other areas where fleas may hide. Use an insect growth regulator (IGR) spray to prevent flea eggs and larvae from developing. Treat your yard by applying a pet-safe insecticide to kill any fleas living in the grass and soil.