Do ear infections go away on their own?

I have a cold right now and my ears are hurting so idk if it’s an ear infection but do they go away on their own?