Ideas are not an endangered species, which is something you know if you've finished more than one piece of writing. As soon as you're in the middle of one project, another one will start jumping up and down, begging, "Write me! Write me!"
Hiker surveys a reach of creek by Price Mary,
U.S. Fish and Wildlife Service
A lot of writers get their story seeds from dreams. Others get inspiration in the middle of researching a subject of interest. Many writers use writing prompts, which can be as complicated as in the link, or they can be a couple of random words. (If you google "writing prompts", you'll find the whole gamut.) The best way I've found to generate ideas is to get away from what I'm working on, where I'll inevitably have a flood of ideas, both for untangling the knot I've written around my narrative, and for working on something new. I also get ideas from books I've read, book recommendations people have requested, roleplaying games I've run or played, people I've met, places I've visited, music I've listened to, or offhand comments I've overheard in public places.
Not that I'm looking to generate anything new. I currently have a backlog. I've been making up stories for my imaginary friends since before I could spell my own name, but the ability to articulate them took longer. Very few of those early ideas were viable, of course, but I did generate a lot more of them when I didn't toss things out because it was unrealistic, or because no one would like it, or because I didn't know how to do the story justice. Working without a filter means you can generate a lot more.
Ideas come all the time. Having ideas isn't the problem, at least not with most of the writers I've read, listened to, and spoken to about it. The problem is filtering those ideas, to turn the good ones into a good story, and to discard the ones that are no good.
Sometimes it's hard to tell the difference. Sometimes you're not going to have the writing chops to do the story justice. Sometimes you've written half a book before you've realized you need to go back to the drawing board. And that's okay, because you can always set it aside for later, or gut the idea to use it elsewhere. That can be a problem if you're writing under a deadline, but, if you're near the same stage as I am, deadlines won't be an issue for at least a year or two, and that's an optimistic guess.
But if you're worried the ideas will dry up, or you don't think you have a lot, it's time to start jotting down story seeds, random observations, and potential plots. I have a document on my computer, which I update from scribbled notes or what I recall of the idea by the time I open my laptop. The file is currently twelve items long, and grows at the rate of about one item a month. More, if I'm feeling restless with my current project.
Ideas are not rare and precious creatures. Ideas are all over the place. It's all about being able to identify them as such, to classify them as a good or a bad idea, and to flesh them out into a whole story.
Once you start collecting your viable ideas, I'm sure you'll be surprised how many of them you have, and how easily they occur to you. Like writing regularly, you can get into the habit of it. Unlike writing on a regular basis, ideas don't need much of a time investment. You may find, in fact, that the less time you have to write, the more ideas you get crowding your head, begging for you to get them on paper.
Ideas, it has been my experience, are not the hard part.