The key question

Will
Going To
Decided NOW, at the moment of speaking (spontaneous)
Decided BEFORE — it's already a plan
Promise, offer, threat
Intention, plan, schedule
General prediction (opinion / belief)
Prediction with visible evidence (you can SEE it)

Side by side

SituationWill ✓Going To ✓
Someone knocks on the door I'll get it.
(decided right now)
You decided last week I'm going to visit my parents.
(plan made in advance)
You see dark clouds It's going to rain.
(evidence you can see)
General belief about the future I think robots will replace many jobs.
(your opinion)
A promise I won't tell anyone. I promise.
An offer I'll carry that for you.
Both can sometimes work: "I think it will rain" and "It's going to rain" can both be correct, but with different shades of meaning. Will = my general feeling; Going to = I can see the evidence right now. In practice, native speakers use both interchangeably in informal conversation.

Predictions: the key difference

TypeFormWhy
"I think she'll win." will Based on my opinion, not visible proof.
"Look — she's going to win! She's way ahead." going to I can SEE her in the lead right now.

Exercises

Exercise 1 — Will or Going To?

Choose the correct form and explain why.

1. "I forgot my wallet." — "Don't worry, I _____ pay for you." (spontaneous decision)

2. He _____ study in Japan next year. (decided three months ago)

3. Careful! That tree _____ fall on the car! (you can see it leaning)

4. I think technology _____ change medicine completely. (general belief)

5. "The phone is ringing." — "I _____ answer it." (decides now)