When a Government introduces a regulation, indirect tax or subsidy that is designed to overcome a specific market failure e.g taxes to discourage consumption of alcohol and petrol, subsidies to encourage installation of solar panels or state provision of education to correct insufficient supply.
Below is a diagram to illustrate how a government can successfully intervene in a market that is plagued with negative externalities. In this instance, there is a presence of a negative externality that causes a divergence between the marginal social cost and the marginal private cost curves. Therefore the only way this externality can be removed is if the government introduces a tax equidistant to the distance between the marginal social and marginal private cost curves. In this case the government has successfully imposed a tax of the correct level and this makes the marginal social and private cost curves equal to each other and therefore firms now realise the negative externality they were producing and therefore the quantity being produced is at the socially optimal level. As a result the dead weight loss triangle has been removed and the welfare for society has increased.