Welcome to the board. Wow, what a big question. Since I don't know where you're starting from or what your goals are, I'm going to assume you already understand the writing process and manuscript formatting, that you're looking for commercial publication, and that you're looking for the most basic information right now, with finer details to come later as you get further into the process.
The first thing you should know is Yog's Law: Money flows toward the author. (Yog is James D. Macdonald, or Uncle Jim, as he's also known here.) Never, never, never pay your agent or publisher out of pocket--not for reading fees, for editing, for co-publishing, or anything else. Respectable publishers pay you for your work and assume the other costs of publishing themselves, and respectable agents work on commission.
To find a reputable agent or publisher, do your research. Go to bookstores and look for books similar to yours. (Publishers who get books in physical bookstores are doing a lot of things right, which is why you want to start there and not by skimming Amazon listings.) Note who published them. Find out who agented them. Check references. (Look in the Bewares and Background Check forum for more information on this step.) When you have a handful of vetted agents or publishers, start querying. Start with top agents and publishers and work your way down--you want experience and influence on your side.
In an ideal world, your queries will generate requests for you to submit your manuscript. Do this according to the agents' or publishers' guidelines. If you get no positive responses to your queries, punch up your query letter and submit to your next round of agents and publishers. During all this, be writing your next book.
If you get an agent first, the agent will submit your work to appropriate publishers (often after suggesting some changes to improve the book). If you get a publisher first, go to your top-choice agent and tell them that you have an offer on your book, and ask if they would they be interested in representing you. In the unlikely event they decline, go to your second-choice agent and do the same thing. (You want someone experienced representing you--publishing is complex and arcane and not for the uninitiated. Don't try to wing it on your own.) When you get a publisher, the publisher will work with you to improve the book, so don't think all the work is over once you get an offer!
While all the querying is going on, make sure you're educating yourself about how publishing really works, what makes a good contract, what you can expect from your agent and publisher, and so on. The more you know, the better your odds of making good decisions.
Best of luck!