Garbage in = Garbage out (GIGO) is a popular phrase used to emphasize the importance of a good source. This can be the soundcard in your laptop, the quality of your portable audio player, or the CD player you’re using for music listening. Those fall into the “Source” category. The better your source is, the better the sound will be at the headphone end. This is why we are seeing more and more audiophile digital audio players (audiophile DAPs). They are expensive but they sound good.
If you just want to block out sound without active noise cancellation, good over-ear headphones will naturally do that to some extent. This is called noise isolation, and it simply works from the earcups forming a good seal over your ears to prevent outside noise from getting in. It's not as effective, but it's less expensive than active noise cancellation and doesn't require power.
Earbuds have small speakers that rest on the ear canal of the wearer. These are usually much less expensive than on-ear and over-ear headphones and reproduce the sound well. However, outside sounds, such as traffic or power tools, can get past the earbuds and interfere with your enjoyment. Earbuds also don't stay in place very well if the wearer is moving much, such as exercising. These also are lower fidelity than on-ear and over-ear headphones.