When you have moles in your yard the best way to get rid of the moles in your yard is to set out traps to trap them.
If you set out live traps then you can take the moles somewhere else and release them far away from your home or yard.
Otherwise they would come back if you release the live moles closer to your home or yard.
Or you could kill the moles by setting out deadly mole traps or putting some mole poison down into the moles holes where they can eat the mole poison.
Then eventually the moles will die.
Moles do help the lawn and soil but they can also be destructive and the best way to permanently get rid of the moles or even gophers in your yard is to trap and kill them.