The first step is to download and build Firefox.
See the information on hacking Mozilla for how to work with the Mozilla project and coding conventions.
If you get stuck at any point, send a question to a Mozilla newsgroup, or get onto IRC at irc.mozilla.org, channel #developers. Do not give up, there are people who want to help you.
If you're looking for a "first bug" to get started with, check out Gecko:First Bugs.