All the bees that nest underground are gentle solitary bees, as well as a few wasps, you do not need to try to make them leave. Just leave them be and they won’t hurt you.
But yellow jackets also nest underground and they are more aggressive and may be a hazard to you and your family, if they are nesting in an inconvenient place. Here are some tips for dealing with yellow jackets:
1. Keep food and drinks covered, and do not leave food out where it will attract yellow jackets. (not just sweets! Wasps are predatory and will seek out protein)
2. Cover trashcans with tight lids so yellow jackets looking for food can’t get into them.
3. Don’t swat at them! That’s just going to make them more likely to sting you.
4. Use yellow jacket bait traps to catch and kill them. There are several ways to make these at home, as well as commercially available traps.
5. If you have a bad infestation and need to remove the nest completely, call a professional! Do not try to do this yourself, you could be seriously hurt.
A final note: if they are wasps over an inch long, they aren’t bees OR yellow jackets, but rather cicada killers, another kind of wasp. They should be okay too. Leave them alone and you shouldn’t have any trouble with them.