Mechanism design is a subfield of game theory and economics called mechanism design that tackles this directly.
Instead of having a game and figuring out how it works and what is the outcome is when agents play it, the problem is to design a game that creates desired outcomes when selfish agents play it.
It's possible to design mechanisms where utilitarian social-choice function is the best choice even when players are selfish. The most famous result in the field is Vickrey–Clarke–Groves mechanism to achieve a socially-optimal solution in auctions. Quadratic voting and quadratic funding is another interesting mechanism that results good outcomes. Vitalik Buterin is involved with this too.