If they're the easy sort, just yell a bit and leave some scary or strong smells. Dog or cat waste, marigolds, mint, hot pepper powder, neem oil, etc. Most of them seem to be reasonable, especially if there's other tasty morsels around that don't come with a cranky human.
If they're the stubborn sort, I have only found two ways that worked. These aren't for the faint of heart - but if you get one of the awful groundhogs / woodchucks, you may come to understand. I'm not talking about the nibblers, I'm talking about the ones who go around trashing whole gardens, digging up walkways and foundations, and climbing into vehicles and ripping the wiring. The ones who are undeterred when they're hit with rocks and sprayed in the face with a hose from three feet. The ones who will charge your dog and give you a vet bill.
One was to wait until the little furry SOB climbed into someone else's engine compartment, snarlingly refused to get out when they banged the hood, opened it and yelled in his face, and started up the truck. They drove far
enough away with him that he never found his way back.
The other was to hit a groundhog with a house. Technically I suppose the house was hit by the groundhog... I roared and charged the beast as he was once again climbing into a garden box in my kitchen garden. He panicked and ran blindly, skidding on the gravel border and slamming himself into the side of the house hard enough to leave a smear before fleeing in a direction he could get some distance.
May all your (and my!) groundhogs now and in the future be the easy reasonable sort!