I've been approached more than once, by writers looking for a publisher, asking questions that include: "Should I get an agent first?" or "How do I know the difference between a vanity publisher vs. a POD or an indie?" I answer them by saying, "You have to do your research and then decide which path works for you."
That might sound like I'm dodging the question, but I'm really not. First of all, in today's publishing world, what worked five or ten years ago is now ancient history. I remember when self-published authors were dismissed as being writers who couldn't get an agent. Not today. The best way for me to explain my response is to share the process I went through to get published.
While writing articles and essays for various regional and national publications, I got comfortable working with editors and publishers. I always worried that, submitting my work through an agent would be giving up some of the control I might have in the details. By the time I had a book I wanted to publish, the self-publishing world was coming into its own, so I decided to research several Publish on Demand (POD) companies, with the thought of seeing my novel in print.
Before that could happen, my husband and I approached a publisher, who had been recommended to us, with our idea about our non-fiction book, "Together in the Dream". After submission of an outline and a sample chapter, he said he would be delighted to publish our work. That was the beginning of what has blossomed into a great rapport with this publisher/editor, and we have three other works in the offing through his company.
Bottom line: all that happened because we did our research. You need to be able to immediately recognize a vanity, POD or indie publisher because you've found out the differences. You need to thoroughly check out a potential publisher: what is their experience?; what genre(s) do they publish?; what do you expect as far as promotion, royalties, etc. There's much to learn if you are going to bypass an agent, and "do it on your own". You have to be realistic about the work that is involved in promoting your book this way. AND, you need to have a positive dialogue with the publisher to know if you are in the right hands.
My husband and I feel extremely lucky to have found the right fit for us. That fit is different for every writer, and it requires having the right information, and knowing what will work for you.