Make everyone bulletproof and bombproof. If it is no longer possible to kill people using weapons of war, then there will no longer be a point to fighting the wars. Either that, or things will escalate to a point where it is no longer sustainable to fight wars that way, also solving it. Mind control, or gelatinising everyone into a singular hivemind is also an option.
Somewhat more realistically, I think that exchanges and the internet are the ways to go when it comes to ending wars. It's a lot harder to fight wars when you can empathise with the other side, and see them as your peers. It's one of the reasons why soldiers who took part in the Christmas Armistice were shuffled around, since they became friendly during the ceasefire, and would be less wanting to fire weapons on the friends that they made.
A lot of wars tend to centre around dehumnaising the other side, and treating them as the "enemy". Allowing people to co-operate and communicate mutually makes it a lot harder for that to take place, since you have experience with the "enemy", they're not that bad. You've even got friends there, and training a gun on them with the expectation and desire to turn them into a corpse is just not on.