What's the difference between "flicker" and "twinkle"? By dictionary definition, they are almost identical.
They have different connotations.
A 'twinkling' light references images like Christmas lights or other pretty, cheerful things. For example, the poem Twinkle Twinkle Little Star is where many native English speakers hear the word 'twinkle' for the first time.
A 'flickering' light has neutral or negative connotations. A flickering candle can be neutral, but flickering lights are usually spooky, or at least poorly-maintained.
'Flickering' implies that the light has the potential to go out completely, while 'twinkling' does not. This is why stars twinkle, and candles flicker.
Both twinkle and flicker have the meaning of a variation in intensity of emitted light, however they are different
An often used reference is to a twinkling star as in the popular children's lullaby. When a star is not twinkling it is already observable, and when it twinkles appears to increase in brightness. Star twinkling is caused by the distance of star from the observer making them appear to be very small sources of light and atmospheric variations. Because planets are closer and larger (as a light/image source) they do not twinkle.
Another often used reference is flickering candle. A candle that is lit will have a constant glow, variation in light output can be caused by slight air movements causing the candle to flicker, in the extreme the candle will flicker before going out.
In terms of connotation, twinkling has a generally positive meaning: the twinkle in one's eye.
Going strictly by the images that are conjured in my head when I read the two words, it's most often a question of degree.
If I read that a light "flickered", I imagine that it is varying randomly and widely, sometimes almost going out completely.
If I read that a light "twinkled", I picture it varying only slightly and more slowly and regularly.