There's no need to be confused.
The rule is extremely simple. The use of 'a' or 'an' depends on the SOUND of the word, not the spelling.
The letter 'H' is pronounced 'aitch' in standard English. This begins with a vowel sound, so we say 'an HR manager' (an "aitch-are" manager )
It's the same as 'an MP'. 'An MP' because the letter 'M' is pronounced 'em'.