knock their nest down into the sunlight and run run run!!!!!!!!! or wait till dark to do it, or get a fire of wet leaves going, fan as much smoke as you can towards the nest, then knock it down and run run run.
Once the nest is in the open and exposed to full sunlight they should go...... unless they are wasps....... then I use napalm, gasoline, thermite and once in a while, Raid.
If they're IN the compost pile, I'm wondering if they are yellow jackets? Are they black and yellow? If so, see if you can spot where most them seem to be "going in", and pour a healthy pile of Sevin all around it. Best to do that at night. They'll track the Sevin back to the queen and kill her.
If they are honey bees, DO NOT KILL THEM!!! Look on the internet, for apiary or bee keepers, in your area. Pest control companies may have access to them as well. Honey bees are becoming more rare now and bee keepers can really use them. They will attract them out with a queen and then take the whole nest away for you, for free.
When I was a "bug guy" we never killed honey bees, as a policy. If someone demanded that we "slaughter them all", we'd make them sign the big, long form getting us off the hook, if the honeybees in their 300K home all died and then did not keep the honey cool anymore so it all leaks into their expensive ceiling.
600 pounds of leaking honey is known to attract ants.
Never run from them. I used to love treating yellow jacket nests, in short sleeves. The technique is, you see where the yellow jackets are entering and leaving and what direction they take. Mostly they are all going one or two directions. Stay out of those lanes of traffic and they ignore you, unless you move suddenly!
You walk up to the nest, take your bulb duster and stick the tube right through the paper of the nest. Give it two slow squeezes, then slowly back up. The YJs come SWARMING out and.... ignore you. If you run or make *ANY* sudden moves, you are scrod.
Don't hate me because I can conjugate that verb
Just back away slowly. Like 1/4 walking pace.
Honeybees are like little babies and bumble bees are like little teddy bears with wings. Don't kill those.
yellow jackets maybe but in grounds maintenance we called them "ground bees" because when you mowed over their hole in the ground they would swarm up your pants/shorts and ruin your day (and then some).
I too have had the ground dwelling yellow jackets take up residence in my compost/mulch areas. The solution is easy-----watch the area for a while to locate the entrance. You then use a opaque jug (like a old fashioned cider/whiskey jug) half filled with water placed next to the entrance. Returning wasps will enter the jug instead of the ground hole and drown----I have done this and don't know why the wasps go into the jug and not the ground hole, but they do. This will kill out the colony in just a few days. I learned this from an old organic reference and used it as I also don't use chemical/poisons around my place. Now for method number 2: I once was mowing and disturbed a nest I didn't know about and got badly strung, I was so mad, I didn't want to wait for the jug method, so I fired up the push mower, tied down the safety handle and parked it over the nest hole. The noise and vibration torqued off the wasps, they came boiling out to the spinning blades of death. Most effective and satisfying in that instance.
Oh....and by the way, plugging the hole won't work, they just dig out a new entrance.