In the writing process we can identify four different stages: prewriting, drafting, revising, and editing. The one used to generate the ideas is prewriting, this is one of the most important stages of the process. It is used to determine the topic and the point of view for a target audience; to do this it is necessary to research and gather information. Otherwise during the next stages you can find out you know very little about the chosen topic, making it hard to continue. For example, if I want to write a novel about a knight during the middle ages in England, during the prewriting process I need to learn how they lived in that time, their traditions, what they ate, how they dressed, the problems people had, etc. There are different methods to help in the prewriting process, some are: brainstorming, freewriting, mind maps, asking questions and outlining.
hope this helps :)