If it is a definite noun, that is you are aware of it beforehand, you use the. If it is indefinite and begins with a vowel, use an. If it's indefinite and begins with a consonant, choose a.
the begINING of the story could be like my dog is cute but sometimes he is really crazy because he likes to run off and almost get runed over and that is the begINING.