If you are looking to be traditionally published, then querying is an inevitable part of the journey.
While casting a wide net is a strategy, it's not a great one unless your goal is a lot of rejection. Narrowing the agent search down via research is one the most important steps along the way.
There are probably as many ways to approach this as there are books to be queried, but I can only speak to my method, which is:
1) I use QueryTracker to filter agents by genre. If I have a sub-genre that is appropriate, I will filter using that too. Then I will hide closed agents.
QueryTracker also allows you to filter to Country, Gender, Members of AALA, Agents on Twitter, and more if those factors are important to you.
2) Next I will go to Manuscript Wish List or use the #MSWL tag on Twitter. This is hugely valuable. Sure, an agent takes fantasy- but do they love sword fighting werewolves set in the 18th century? This step might help you figure it out.
That said, I would strike someone off my list if they didn't specifically list a love of sword fighting werewolves, but if they mention they hate werewolves, or sword fighting is an auto no/trigger then I will proactively avoid that rejection.
3) Agent/Agency websites are next for me. They can provide good insight into the agency, who their clients are, and what kind of books they represent.
4) If you have access to Publisher's Marketplace, this would be my next step. You can look at an agent's recent sales (if shared- they aren't always). This can give you a sense of if the agent you're looking at reps similar books- which can be great.
But, if the agent has a recent sale for a book that sounds super similar to yours, it might be too similar to work for their list.
5) You can start to narrow things down here. Check out Writer Beware, the Absolute Write Forums, Query Tracker comments/forums. Publisher's Marketplace can also be a good indicator of legitimacy as it shows sales.
Don't discount a newer agent with no sales, though! Consider the agency, and who might be mentoring this agent. Everyone has to start somewhere!
6) Individual agent research!
If you are planning on personalizing your query, you will need to do this anyway. I prefer to do it upfront and take notes on why I thought this agent might be a good match for me.
I look at the agency website, search for interviews on YouTube and Literary Rambles. Read/watch "How I got my Agent" posts specific to the agents I'm interested in. You can also follow agents on socials that they share on. #AskAgent on Twitter is also a great chance to learn more about an agent.
QueryTracker (free or $25 a year)
Publisher's Marketplace ($25 a month, or $10 quick pass)