When I’m coming out of the shower or driving in the car, if a musical idea came into my head, I would immediately sing and record it into my phone. If I’m sitting at the piano and happened across something, good or bad, I recorded it.
I learned from Allen Toussaint that there are no bad ideas but only that some ideas work better than others in certain situations. So having more ideas than you need is a good thing.