A public good is a good which is freely available to everyone once it its supplied. It is freely available because no one can be excluded from benefitting - meaning that it is subject to the free rider problem. Despite public goods such as street lighting, defense and policing generating benefits, markets are unlikely to supply them (or enough of them) because of the difficulty of charging free-riders.
For example, when street lighting is supplied, everyone in the locality benefits.
Public goods exhibit three other properties - non-rivalry, where users or consumers do not need to compete between each other to gain the benefit of the good; non-diminishability, where consumption by one does not reduce the supply to others; and non-rejectability, where consumers/users cannot prevent the good being supplied to them, as with national defence.
This means that, unlike private goods, public goods are unlikely to be provided through the price mechanism. Public goods are typically supplied by the state, and funded by general/national or local taxation. In this way, government solves the free-rider problem by making the good free at the point of consumption to those that need and want it, and, indeed, to others who may not need or want it.
Quasi-public goods, such as roads, bridges and parks exhibit some of the characteristics of public goods and private goods. For example, drivers can be excluded from some roads and bridges through toll systems, or through electronic charging. This means that the private sector can become involved in the building or operating of the quasi-public good.
Read more on public goods