Research is hard! There are no clear rules for finding the perfect research topic.
A good topic is one that is interesting (both to you and the professor), original, and feasible. The more novel the research, often the harder it is to find good data.
So, how to find a topic?