I am on a number of book publishing forums. Regularly, a new author complains about the difficulty of finding an agent. Others talk about self-publishing. And then I read stories of people who have paid large fees to "agents" or "publishers" and I cringe. So here are a few thoughts.
There are plenty of agents who are looking for new authors. However, you can't just bombard them. You need to find agents who are interested in the kind of book you've written. Many authors mention their agents in their acknowledgments. Look at books in your field or genre or aiming at a similar audience. Then, look at the agent's web site -- every agent has requirements for how to submit to them. One I'm friendly with requires submissions online and is very specific about the process. In return, she reviews and responds to every submission. Not all do.
Ignore any who ask for a fee. They are not real agents. An agent is a broker who represents you in a transaction for a commission. Also, any "publisher" who asks for money isn't a real publisher. A publisher is a manufacturer who licenses your product (i.e. book) and takes the risk of producing and marketing it. They get your intellectual property and pay you a royalty when they sell it (or in advance). The money goes from them to you; not the other way.
A comment on one of the forums recently said the difficulty in finding agents is leading to more self-publishing. I don't agree. It's always been challenging to get an agent. It's always been challenging to get published. Ironically, more books than ever are being published by real publishers, and most of them are sourced through agents. However, more people than ever seem to be writing books. Most of what's called self-publishing is really self-printing. Just because you now can easily get a book printed or set up for POD...that's not publishing. Publishing is a business that includes sales, marketing and distribution, editorial development, design and manufacturing. If you're not expert in these areas or willing to become competent, you are unlikely to be successful at self-publishing. There are always exceptions, but that's what they are.