Plötzlich kam mir eine gute Idee in den Sinn.

English Translation

A good idea suddenly struck me.

Ignore this garbage translation and switch it to the actual translation: “Suddenly a good idea came to mind”