When you are doing something and you suddenly get a good idea you should write that idea down as soon as possible. Though you could just keep it in your memory until you end up using it, by doing that you risk having your sudden idea change completely into something else. This is because in our minds we tend to try to improve upon thoughts and ideas. By doing this the idea will evolve until it is a different idea. Write the idea down as soon as you possibly can to keep the idea fresh. Doing this will also allow you to develop upon your idea the proper way.