Goundhogs are cagey and extremely difficult to trap. You probably don't want to hear this, but if it wants to it will dig its way in your house. Maybe you don't have a basement but if you do digging is their favorite hobby.
We have a creek running through our farm and are cursed with them. Never caught one in a live trap.Or a leg trap. What you want is a Duke body trap..be sure to buy the Duke safety setting tools, both of them, check Amazon. Use cantaloupe and be patient. Now if you have any local cats or dogs and cannot put the trap in an enclosed space, that's a non-starter. Our GHs dig into our machine shed from the outside and we place the trap in the shed with the door always closed.
FWIW we have live traps and use them on coons and other varmints, but groundhogs are destructive, smarter then Sh%$, and they get the big goodbye at our place.