When to use the word an in a sentence?

When words starts with a,e,i,o,u then we put an in front of these words.

and those words which are sounds like wovels for example hour we pronounced it as our.