Even though I am a native English speaker, I am old and have forgotten my English grammar lessons. Need a little help to understand why I would write a sentence that way using the words going to even though I've always done it that way.
It's a form of the future tense in English.
ThoughtCo.com: "expressing future tense with 'will' and 'going to'
As to why "going to" is used as future tense in English, I'm going to pass on that one. Maybe someone else will chime in.