The difference between will and going to is often confused by English learners. The important thing to remember is that going to is used for intentions and plans, intended or made before the moment of speaking. Will is for offers, requests and promises made in the moment of speaking. A good way to practice
will vs going to is to do as many exercises as possible, making sure you understand the difference. Then during your next English conversation, try to use both of them in the correct way.