The ear is an amazing transducer of sound to chemical energy to perception of sound in the brain.
It requires sound to travel down the ear canal and hit the ear drum. This vibrates the series of 3 tiny bones called the malleus, stapes and incus. These in turn push on the oval window and generates a pressure wave which is magnified about 3 times the original sound in a snail like organ called the cochlear. On the cochlear, like the keys on a piano, different sounds stimulate different keys and so the message is passed onto the brain as sound and interpreted.

Issues can arise when sound is not getting in, for example when ear wax is blocking the outside ear canal. This can be easily removed. Another issue can be when the ear drum is damaged (eg has a hole in it or has something pushing against like fluid or wax so it can not transmit the sound waves). Fluid can be due to accidents or colds. This is treatable but may take time to get right (at least 2 weeks).

Loud noise is probably the most common cause of hearing issues (eg loud headphones or loud concerts or jet engines or guns firing). These loud noises can be like someone breaking some of the piano keys, so no sounds play or only louder sounds are able to be heard. This can be irreversible. Another issue is that occasionally there is a problem with the nerve or brain which causes deafness. All this can be determined by seeing your doctor and having other referrals like to see an audiologist. In old age, parts of your hearing can get worn out, and this is called presbycusis.