People are good at thinking up stuff, and making it work while we cannot. It seems like somebody else have all the great ideas. All of us have creative potential. You are drifting off to sleep while you come up with a great line. Did you just smile and go back to sleep? But chances are that we do not hold on to that idea by morning.
We need to be capturing ideas. A good idea flies at lightning speed and so we need the habit of writing it down somewhere, chances are that the same idea may not come back. The point is to document the idea and then evaluate if you require it or not.
After you get that idea take time to research it. Try finding books or articles about it. Chances are that you will interconnect it with things you already know with something else. Talking to your friends also helps. The deal is to document them first. There is always a show going on in our mind. You have the power of bringing your thoughts into reality. Pay attention to the ideas you generate.
Some great places you may get ideas are coffee shops, restaurants, conversations with people, books, while debating, at an event, on social media, etc. Sharing ideas may spark more ideas.