It's a hard one, because it needs practice!
will = deferred decision
Ex: If it rains, I won't go.
In this case, the decision to go or not has been deferred. The dude is waiting to see what the weather looks like.
Note: Spontaneous decisions like the one answering the doorbell, "I'll get it!", count as deferred decisions. That is a bit hard to grasp, so don't try to explain that one. Just use the following rule:
Use "will" with deferred decisions or spontaneous ones.
going to = decisions already made
I'm off to the shops. I'm going to get some bread.
I think this one is self explanatory!
Use "going to" with decisions made prior to the present moment.
This rule applies to ALL uses of "will" and "going to". Go on. Test it!