Ideas can come at any moment. Depending on how you choose to express yourself creatively, they can come in any form also. My advice in situations like this is to have as many ways to capture your ideas as close to hand as possible. Primarily I think and create visually, but I sometimes make music also. If I have an idea for a song, I have a voice memo app close to hand that I can hum into.
If it’s a poem or song lyrics or an idea for a movie or TV show, then I have a sketchbook or a notetaking app on my iPad ready to go.
The reason I say have them close at hand is because some ideas decay fast. They longer and idea has to linger before its captured the more it gets diluted and corrupted by other thoughts after which it is not as pure and ‘Eureka’ as when you first thought of it.
