Hello; I am an Audiologist.
Based on your description, it is unlikely that you have an ear infection. If that were the case, you’d be complaining of acute pain, significant decrease in hearing, and possibly fever, tinnitus, or dizziness.
Eustachian Tube Dysfunction is the most probable cause, and as others have suggested, it might help to take an over-the-counter decongestant or if you have allergies, take your allergy medicine consistently for a while. Of course not all medications are safe for everyone, so be careful if you have any other medications or conditions that contraindicate taking decongestants or antihistamines.
You could try popping your ears via the ValSalva technique, by holding your nose and mouth closed and very gently blowing to force air pressure up into the middle ear space.
As long as it’s just a dull pain with little or no change in hearing, give it time. Often, when I get a cold and my ear hurts, I run a tympanogram on myself to measure the pressure in my ear. Usually I come up around -90 DaPa, and the range of normal goes from +50 to -150 DaPa. So even though my ear hurts, and there’s a noticeable change in hearing, it’s still normal. Then I berate myself for being a baby, because I see patients that are way worse all the time!
I hope this is helpful, and that you feel better soon!