(be) going to

A. We use (be) going to: To talk about plans and intentions, and something is likely to happen. I am going to do something = I have already decided to do it, I intended to do it. (e.g. Are you going to watch the late film on TV tonight?)
A1. We often use verbs: would like, plan, want, mean, hope, expect to talk about the future. (e.g. What are you going to do next year? I’d like to go to University)
A2. use modals: may, might, and could when we are not sure about the future. (e.g. I might stay at home tonight, or I might go to the cinema.)
A3. can use should if we think something is likely to happen. (e.g. We should be home in time for tea.)

B. I am doing (present continuous) when we say what we have arranged to do ~ , arranged to meet somebody, arranged to go somewhere. (e.g. What time are you meeting Ann this evening?)
B1. I am going to do something = I’ve decided to do it (but perhaps not arranged to do it) (e.g. Your shoes are dirty. Yes, I know. I’m going to clean them, (= I’ve decided to clean them, but I haven’t arranged to clean them)
B2. We can use also say that something is going to happen in the future. (e.g. Look at those black clouds! It’s going to rain. (the clouds are there now))

C. I was going to (do something) = I intended to do it, but didn’t do it. (e.g. We were going to travel by train, but then we decided to go by car instead.)
C1. You can say that something was going to happen (but didn’t happen) (e.g. I thought it was going to rain, but it didn’t.)