'It's sunny outside. I am going to wear my sunglasses' expresses a decision made based on the current condition (sunniness). 'I will wear my sunglasses' also expresses a decision made at the moment of speaking due to the sunny weather. Both are grammatically correct and convey a similar meaning of an immediate future action. 'Will' often emphasizes a spontaneous decision, while 'going to' can suggest a slightly more considered intention, but in this context, the difference is minimal.