Most of the time, you can use “will” and “going to” interchangeably
to predict future happenings and situations. So you can say:
"I think the weather will be nice later."
or
"I think the weather is going to be nice later."
These are some high-quality shoes. They’ll
last a long time.
or
These are some high-quality shoes. They’re
going to last a long time.
However, there’s a difference between the use of “will” and the
use of “going to” depending on whether you’re talking about something that you
know/decide at the moment of speaking or whether you’re talking about something
you've known for a while/decided a while ago:
“Hey Dani, let’s have a dinner party!” “Sure thing, Mia! We’ll invite lots of
people.”
- Here, you use “will” to announce a new decision.
The dinner party is a new idea.
Later that day, Mia breaks the news to Raoul:
“Dani and I have
decided to throw a dinner party. We’re going to invite lots of people.”
- In this example, “going to” is used because the
decision to do something has already been taken. Mia had already decided to
invite lots of people before she
spoke to Raoul.
Also, when you say something is going to happen, you know
this from the situation now. What is
happening now shows that something is going to happen in the future:
“Look at those black clouds. It’s going to
rain.” (not “It will rain.”)
“I ate too much. I think I’m going to be
sick.” (not “I think I’ll be sick.”)
Be advised that using “gonna” in written language
will most definitely incur the wrath of the grammarillo.