I have previously collected answers on As historians how do you find sources and put them into context when writing a book?
See also When writing a historical book, where do historians find their sources? by /u/CoeurdeLionne, /u/alriclofgar and /u/restricteddata
The subreddit FAQ has a section about History Careers and Education.
I have a masters degree in history and am currently working as an Archivist in Library and Archives Canada so I work with historian daily on top of being one. The process mostly includes a lot of reading and note taking. First you go through all secondary sources (publications) and get an idea of the historiography (history of historical works) on the subject. This gets you to understand the different theories and how they’ve evolved over time and what different historians proposed.
Once you’ve mastered the publications you would move on to primary sources (archives) and read the actual documents that were written in the time the event you are studying happened. This can include a lot of deciphering palaeography (old writing and penmanship) and translation. If you’re lucky, some of these documents are digitized or microfilmed but most likely, you have to spend weeks, months or years in an archival centre, methodically going through old documents to determine what is important and what isn’t, contrast the different views of the people who wrote about the event. You have to evaluate all the biases of the people written to try and understand what would affect their judgements and opinions, and what would make them lie or deviate the truth.
With all of this done, you would go through all the evidence you’ve gathered and base your argument out of this. Once written article goes through peer review, which means that other historians in the field will read your paper and tell you their opinion, and where your argument is weak. You would then review it to fix these mistakes, usually multiple times.
Historians work follows a scientific method, as much as it can. Since we cannot reproduce the results or see the events yourself, it cannot be a science. We look at history through the biased lens of the people who lived it and attempt to gleam the truth as best as we can.