My ear was in pain for about 2 days. I thought It was just an ear infection. The pain is gone now but I can't hear very well. What can I do?

Check it out. Pain in the middle ear can be many things, including viral issues that self heal or bacterial ones that may require antibiotics for quick resolution. With any, there is often accumulation of middle ear fluid that slows down the movement of the ear boned (suppresses hearing). It can take weeks to improve.The only way to know if it needs antibiotics is to have it checked.
Have it checked. Often after an ear infection clears there remains fluid behind the ear drum causing difficulty hearing. Have your doctor check your ear.