Yes, these two letters are exactly different letters and it's pronunciation also different.
The source of the sound is different.
For example:-
محمد ، نصيحة ، حق (truth, advise and a person's name)
هدى ، هم ، قهوة ( coffee, grieve and right path )
Only through conversation or watching some Arabic program, you can understand the difference.