There are a lot of variables to take into consideration when thinking about the publishing market.
First, what are you writing? Different types of books are published by different types of publishers, and each kind of publisher has a different process. Poets, for instance, very rarely have agents, unless they become very well-known (which, let's face it, doesn't happen too often). Fiction and nonfiction writers don't always have agents, especially if they're publishing their work with university or small presses.
If you're writing fiction and nonfiction and have hopes of publishing with a large trade press, you will need an agent. Otherwise, as others have mentioned, you'll end up in the slush pile, and the chances of your work receiving serious consideration aren't good. Even with an agent, a new writer often doesn't fare well with the big presses. Publishers are always looking for new voices, but they're looking for writers with proven track records, too, so often you have to start out with a smaller publisher and work your way up through the ranks.
A lot of writers start out by getting some experience by writing shorter pieces and submitting them to literary magazines. Beginning writers tend to publish in smaller journals, and as they build up more experience (and write more, which helps them to become better writers), they usually start to publish in some larger journals. New Pages has an excellent listing of different literary journals and links to the journals' websites. If you're writing nonfiction, you might start gain some experience by writing freelance pieces for magazines or newspapers, as well as for websites. I don't read or write genre fiction, so I don't know of any journals or agents who specialize in genre fiction, but I'm sure you can find them by looking around online if that's what you're writing.
Having some publications by the time you start looking for an agent will give you a good reputation and will show prospective agents that you have some promise as a writer and could be a good client for them to take on. It's not a requirement, but it does help. To find information about literary agents, look around online to start. I know there's at least one good online listing of literary agents, with some information about the kind of work they're looking for and how to contact them. Not all agents represent all kinds of writers; some focus specifically on young adult fiction, for instance, or on popular nonfiction like self-help books and the like, and you'll be wasting both your time and the agent's if you submit work that doesn't fit what they want.
Before you contact an agent, I strongly encourage you to have someone read and critique your work. You can do this by taking a creative writing class at a local community college or looking for a writer's group to join. If your work isn't the best it can possibly be, you'll again be wasting both your time and the agent's. Rejection is something all writers face, even if they're very talented, and it's something you have to develop a thick skin to deal with. But sending work out before it's ready will usually mean either harsher rejections or very generic ones that are of no help to you.
Once you find a potential agent, you need to find out what they want. Most will ask for a letter in which you describe your work (a query letter) and sometimes a short sample (a chapter, 20 pages, something like that--their website should specify). Never send the entire work unless an agent asks for it. Some agents will just ask for a query letter and will only ask for a sample of your work if your description of it interests them.
If an agent decides he or she would like to represent you, you and the agent will usually sign a contract detailing what the agent will do for you and what percentage of your profits from anything you publish the agent will get. NEVER EVER give an agent any money. Any agent who asks for a fee up front is not a reputable agent and is trying to rip you off. The only time an agent may ask you for money is if he or she is entering your work into writing contests, most of which have entry fees. Ask what contest it is and do some research yourself to make sure the agent isn't trying to rip you off.
I encourage you to take a look at a recent edition of the Writer's Market, which has information on all kinds of presses and publishers. It's an expensive book, and it gets outdated quickly since a new edition comes out every year, so I think the best thing to do is go look at one at a library.
There's also the possibility of self-publishing, sometimes called "vanity presses." This really isn't a good way to go, because you're paying to publish your own book. It's hard to develop a good reputation in the publishing world if you've self-published, because you can pay to publish anything of any quality. I've heard that some self-publishing companies are gaining more of a reputation, but I haven't been keeping up with them. If you just have one book you want to publish, or you don't plan to try to make a career out of writing, this could be a possible way to go, but I don't really know a lot about the process.