Speaking just of paper books, i.e. not e-books (which others have already discussed):
There are basically three ways to publish a book:
- "traditional" publisher;
- vanity press;
- print on demand.
With a traditional publisher, it should cost you nothing. They may pay you an advance if you're lucky. You submit the manuscript, and if they like it they publish it. They keep some (most) of the price of the book and pay you royalties.
Advantages: Costs you nothing. You get the marketing power of the publisher behind your book.
Disadvantages: Unless you are already famous, it's difficult to find a publisher who is interested in a writer's first book. You lose a lot of creative control: the publisher will likely insist on many changes.
With a vanity press, you pay a pretty large amount of money up front -- usually several thousand dollars -- for them to print your book. Then it's up to you to sell it. They make their money from this up-front cost.
Advantages: They may provide assistance with editing, cover design, etc. They may do some marketing. (Depends on which vanity press.)
Disadvantages: You have to pay a bunch of money up front.
Print on Demand (POD)
With print on demand, you send your book to the POD company, and they print copies in small batches -- often as little as one at a time -- as they are sold. They keep some of the price of the book and give you the rest. You get a much bigger chunk of the sale price than you would with a traditional publisher, but that's because they don't do much for you. They print your book, period. (They may provide additional services, like cover design or editing, but you have to pay for that up front.)
Advantages: Very low up-front cost, ranges from zero to maybe $100 or so. You retain complete creative control.
Disadvantages: Few POD books are sold in bookstores: almost all are sold on-line at Amazon, Barnes & Noble, and many smaller on-line sellers.
Personally, I'd rule out vanity presses. I don't see that they have any clear advantage over POD, and you have to give them a bunch of money. If someone on this forum can offer reasons to go with vanity presses, I'd be interested in hearing them. But basically I think they're just out of date.
I think the two biggest POD publishers are CreateSpace and Lulu. I used Lulu for my first book and CreateSpace for my next two. Both appear to be solid, honest companies. I worked with a traditional publisher on another project that never made it to print for a variety of reasons.