Before the moment of speaking use going to. At the moment of speaking use will.
For a decision made before the moment of speaking we use going to.
- On Saturday I am going to the zoo.
(A plan.)
For a decision made at the moment of speaking we use will.
- Tom: Tea or coffee?
Jerry: I will have tea, thanks.
For a prediction based on something we know now or evidence we use going to.
- The traffic is bad. We’re going to be late.
(We can see the traffic is bad.)
For a prediction based on opinion we use will.
- I think we will be good friends.