Look through reference resources on very broad topics, or browse through your textbook for ideas. Once you have a few ideas, start to analyse them for the hidden research questions inside the broad topics. This is topic analysis, figuring out what the different aspects of a topic are, and which of them you want to investigate. A topic is sometimes assigned to you, or presents itself quickly as you think about a project. Even then, you'll need to evaluate your initial ideas to make sure your topic is both interesting and manageable.
Good topics are neither too broad or too narrow.
Good topics have some elements of mystery or controversy. Good topics can lead you and your reader in new directions or can make a tired old issue new again by considering alternate aspects. Once you have an initial idea, start to explore it a little. Note what facets of the topic you find interesting and consider those as possible research facets. Sometimes exploring a topic by browsing through current issues of journals can help you locate information you find interestig enough to work on for a project.