Getting water in my ears is the thing that bothers me the most about swimming. The sound and feel of water sloshing around by my brain is far too distracting for me to perform well. When I began swimming to train for a triathlon, ear plugs were one of my first purchases.
The rubber earplugs that Speedo makes have worked the best for me. They have flanges on them, so can be cut to fit ear canals of different sizes. They fit snugly without being too far in the ear. I have never had them fall out, even in the rough waters during a race. Each time I had them properly seated in my ear canal I never had water come in.
They come in a small carrying case that helps you keep track of them. They're pretty easy to misplace otherwise because they are small. They are sold in groups of threes, which is really clever because invariably you will drop or lose one.
So, whether you swim competitively or just like to spend a lot of time in the water, Speedo rubber ear plugs are a great way to keep water out of your ears.