Getting water in your ear is a hazard of swimming under water. Sometimes the water will travel deep into your ear canal and be unable to escape. This creates an irritating sloshing sound, and can ultimately result in an ear infection if the water is not removed. Getting water out of your ear is therefore very important, and relatively easy to do.
Lie on your side with the affected ear facing toward the ceiling.
Dip a cotton swab into a container of rubbing alcohol. Make sure it is completely saturated and the alcohol is dripping from the cotton swab.
Hold the cotton swab soaked in alcohol over your ear, and let a drop or two of alcohol fall into your ear.
Sit up. You will likely hear a small "pop" as the alcohol meets the water and helps it evaporate.
Repeat with your other ear if necessary.
You will probably want someone to help you with this. There are ear drops that are commercially formulated to remove water from the ear in the same manner as the alcohol. However, the alcohol is much cheaper and just as effective.
If you are unable to get the water out of your ear in this manner, seek medical attention.