Honestly, many of the answers here miss the point. It has little to do with pronouncing the “h”, though it would of course always be “an hotel” if it not be pronounced.
Simply put, it is generally considered permissible, though not mandatory, to use “an” in front of words that start with /h/, but do not have their accent on the first syllable. So one can say “an heroic deed.” because the accent is on the second syllable, but not “an hero”, because the accent is on the firs syllable. “a heroic deed” is also acceptable.
https://www.writing-skills.com/hit-or-myth-use-an-before-h-words