I pride myself in being a nuts-and-bolts type writer, meaning I'm not much for the woo-woo stuff. Having said that, I do admit that I've had story ideas come to me in dreams. I know that dreams are seen as the interpretations of our subconscious, but I'm convinced they're more than that. Some insist that dreams are another form of inspiration given to us by the Muse. Most dreams we forget, unfortunately, but once in a while these sleep
visions stick with us. If the images were particularly strong, sometimes
upon waking we're confused about where we are and what's really happening.
The Bible mentions dreams and the most famous sleep vision in Scripture comes from Genesis 41, when the pharaoh dreamed of seven fat cows being eaten by seven emaciated cows, and seven plump stalks of grain being swallowed by seven thin stalks of grain. Joseph (he of the Technicolor Coat) is summoned to interpret the pharaoh's dream, which he does by explaining that seven good years of harvest will be followed by seven years of famine. So forewarned, the pharaoh appoints Joseph as his second-in-command and is tasked with storing and managing surplus food to prevent disaster.
As writers we're cautioned against using dreams in our work because dream sequences are regarded as narrative cheats. What happens is that characters wake up and nothing has changed. However, dreams in stories can be useful to build tension and foreshadow plot twists. We know that dreams can be symptoms of a troubled mind and in a story, an immersive dream sequence can illustrate the interior turmoil of our characters as they contemplate danger.
A dream that I used for a recently accepted story was one in which women suddenly stopped getting pregnant. I have no idea why my subconscious stewed on that horrific notion, but the takeaway was the global terror upon realizing that we as a species now had an expiration date. Lately, two other dreams had to do with me getting older, so it's pretty obvious what's behind that inspiration.
Another source of dreams are hallucinations from drug use. Here in Denver, we have Initiative 301, in which we get to vote on decriminalizing the use and possession of psilocybin mushrooms. I've known people who've indulged in "magic" mushrooms and then shared their mind-blowing experiences, which by the way, included plenty of vomiting. None of these psilocybin tourists ever got around to writing anything, so the best way to cultivate inspiration remains to sit at the keyboard and hammer out what the Muse delivered.