A public good is nonexcludable and nonrivalrous. An example is national defense.
Nonexcludable means that it is costly or impossible for one user to exclude others from using a good. Nonrivalrous means that when one person uses a good, it does not prevent others from using it.
An example of a public good is a national defense. Regardless of whether you choose to be covered by national defense, you will still benefit from it and will not be excluded from being protected. It is nonrivalrous, because even it someone else is benefiting, it does not prevent the rest of the society from benefiting at the same time.