The answer to 'how to prevent wasp' is to take proactive steps to eliminate wasp nests and discourage wasps from building new ones around your home. This includes regularly inspecting for nests, removing any you find, and making your home and yard less attractive to wasps.
Start by thoroughly inspecting your home's exterior, including under eaves, in attics, and around windows and doors where wasps may build nests. If you find any active nests, it's best to call a professional pest control company to safely remove them. Trying to remove a nest yourself can be dangerous, as wasps will aggressively defend their home.