What do I mean? Let's say you were in the Army for 20 years before you retired and now you want to write a mystery set on an Army base. You probably don't have to do much research. You know the how people in the Army talk, think and interact. You know the jargon and the social and work structure. You lived it. But unless you were an MP, you might have to research how MPs investigate crime.
Most of us writers have not lived the stories we are writing. My current WIP (Work in Progress) is set in 1881 which is 79 years before I was born. So I obviously haven't lived it. However, since it is a western/fantasy mashup, there are some tropes of the western genre I can use. But I also want the novel to be historically accurate (full disclosure: I made up a town called Plain Water that never existed for the first few scenes of this novel). The first few chapters (so far) have been set in the Arizona Territory. I had to find out where the train tracks had been built to (all the way across southern Arizona, the second trans-continental railroad, by the eay). I needed to know where the mines were around Tombstone. I needed to learn about the weapons of the period. I needed to know how far one could reasonably travel by horse. I needed to know if Tombstone had telegraph service in 1881 (it did). You get the idea.
You can't do too much research. Even then you'll probably miss something important that a person more knowledgeable about the subject will catch. Even if you are writing an epic high fantasy that you are world building, you might have to research sword making, types of bows and arrows, types of buildings, horses, etc. (unless it's all going to be magic). Yes, the internet is a wonderful place for research (although Wikipedia is not always accurate). Other sources: books (nonfiction and fiction if you think the writer knew what they were talking about), documentary movies, fiction movies (if done well), talking to people who lived through it, visiting the place yourself (although this takes time and money; the only major setting in my novel Agent of Artifice I never visited was Havana, Cuba). Even old encyclopedias because they might have a perspective that it's hard to capture today. For example, my wife's family has a set of encyclopedias that refer to World War I as "The Great War" (World War II hadn't happened yet).
Sometimes multiple sources disagree on the facts (especially historical facts). Then you have to decide which one you are going to use.
But there is a mistake you can do with research and that is to show off what you know. Oh, you found out something really cool about sword making and you want to share it with your reader. But unless it is germane to the plot, don't do it. It'll stop your narrative dead and leave your readers wondering why. Yes, I know it's interesting (to you) and you did all that work. But your reader mostly likely won't care. Just use the research that is essential to your story and moving it along.
Research everything you don't know 100% about. And don't show off how much you researched. But you can't do too much research.