Will expresses a future fact.
Will is used to make a promise, an offer, a threat or refusal.
For example:
The sun will rise tomorrow.
I promise I won’t tell anyone you broke the window.
I‘ll take you to the airport tomorrow.
I‘ll tell your parents what you did.
No, I won’t cook your dinner, you can cook it yourself.
Going to is used to describe something is about to happen.
For example:
Get back! The bomb is going to explode.