Getting a hernia is pretty much genetics!
If you got weak connective tissues in your groin than you will get one, thou your are training or lying in your bed for the rest of your life.
In this case prevention can't stop that.
It is also possible to get one, when you got imbalances (muscular or bones)so that one side have to compensate the load more for the other side.
Here some prevention can help like stretching the groin region and training abs.
If surgery is necessary than I would recommand a mesh. With a mesh training after 14 days is possible. Hard training should be avoided for the next 3 months.
The mesh can hold it for the next 20-25 years but in general ther is no need to change it.
Hernias on the other side are possible.
While this phase, your focus should be on core-work and stretching. Front-Squats or very light Squats (olympic) are better than the leg press, because the leg press puts too much pressure on the groin!
Won't performe any Deadlift. Rows are better. Chin ups/Pull up can stretch too much. You will be surprised how important the core is for weightlifting.
Conventional surgery is an option but not a good one. Here the Doc closes the hernia by fixing the abdomens together.
That was no fun! This has been the worst muscle soreness I've ever had!
The possibility of getting another hernia (on both sides!) here is hgiher than with a mesh.
Training for the next 3-4 Month are impossible!!! No Abs and others!!
Walking, swimming and bicycling is an option but depends on your pain.After 2-3 month light jogging is possible and I would start streching and light (!) core work. After 1-2 month if light training, start weightlifting light. No Deadlifts. After 3-4 month you could incorporate them, but it really depends on your pain!
There are other options like the "sandwich method". Sounds strange but as far as I you it is the best method. The groin channel (right word?) are closed. If you do it on both sides, than a getting a hernia is pretty impossible.
As with the mesh, after 14 days workouts are possible. Heavy loads are also for the next 3-4 month a no-no.
I can't point out enough on the core work and stretching after a surgery! I was afraid after my hernia to train the abs and to stretch. My lower back was getting stronger also my inflexebility. Now I got some slipping discs as a result of weak abs!
Don't be that fool, bros!
Last advice: when it is possible, you should work with physiotherapist or a doc who knows about weightlifting and the special needs for this training or ask a strength coach who gots some experience with that sort of injury!