Choosing a suitable problem requires deep insight. Often a student just finishing coursework won't have that insight yet. Insight comes from very deep dives into the essence of a problem space. It is an emergent property, not easily or automatically attained.
Hence, students are often guided to a problem (or problems) by their advisor who does have this required insight.
I once had deep insight into classical real analysis and classical topology, but almost none in algebra. This seems odd, but I think it common. I entered the research stage as a good and hard working student, but didn't have sufficient insight yet to come up with a problem on my own. My advisor was a great help.
In fact, it was in working on my eventual dissertation problem that I got that insight. I don't think I could have really considered myself a mathematician until I was at the end of my research. Only at that point was I able to "bank" a number of future work problems that seemed to be important enough for further study.
Get a good and experienced advisor. Accept their guidance.
There are a few students who don't need this advice and come with a problem of their own. Sometimes that works out. But I doubt that, in math, at least, that it is the most common case.