I understand the basic concept, but as far as what question to ask of my primary sources, I am lost. Should the sources lead me to a question or should I have a general question in mind going into the research? If you know your general question going in, how did you come up with it?
I realize this is a somewhat strange question, but it's the aspect of history that I struggle with the most.
Hi! You might find some useful discussion on this front in this previous Monday Methods post about writing a paper. The whole series on the research process is really good and you can find links to rest of them in the FAQ here.
To your specific question about "what comes first, the research or the question?" the answer is, well, "yes." Which is to say, one rarely knows exactly the research question one ends up with when one starts the research process. You start with a provisional set of interests and questions and as you do the research, you start to hone in on what the actual research question is.
So you do need something to guide your initial investigations, but you should always be free to change the question.
Let me give you an example of a paper from graduate school I did. While researching a different paper, I stumbled across a newspaper article from the 1960s in which a scientist claimed to be a holder of the patent on the atomic bomb (as part of explaining in a court of law why they were an expert on the atomic bomb). I thought, that's a weird claim — since when did the atomic bomb have a patent? What does that even mean, to patent an atomic bomb?
So that became my initial question: what the heck did this guy mean. I actually was able to get in touch with the scientist (who was still alive), and he told me, over the phone, "yeah, there was a patent on the atomic bomb, I had to sign paperwork on it," and gave me the name of the guy who made him sign the paperwork. I started poking around for that guy's name (Captain Lavender), and in turns out he was in charge of the Manhattan Project patenting program. Once I started picking at that itch, I found lots of research files that had never really been used before, and ended up uncovering a whole story.
At this point my research question started to change as I learned a lot more. It stopped being "was there a patent on the atomic bomb" and became "what was the purpose being served by the Manhattan Project patenting program, why did it start, what happened as a result of it?" And other more detailed questions that I couldn't have imagined when I started it, because I had never heard of any of this.
The more I learned, the more insight I gained into the things I wanted to learn, and where to find them, as well.
So it is an iterative process. Now, there are times today, because I have been doing this for 20 years or so, where I can go into a paper with a clear research question already articulated and it doesn't change as I do the work, but that's because I've already done a lot of the legwork and am not coming to these things for the first time. But whenever you venture into a new area of research or thinking, you are going to have a lot of back and forth on the research work.
When I advise undergraduates doing thesis work, I always say: start out asking the more basic and probably dumb questions you can, because you don't know that much yet about what you are going to find in the sources. Read the primary sources for what they say on their own terms before you try to interrogate them with your own questions. Eventually, if you do this and keep working on it, you will figure out what you actually are interested in really asking in the end, and the question posed by your paper will come to you.