First of all, decide what type of riding you want to do. If it is all off road, get a mountain bike. If it is all on paved surfaces, get a road bike. If it is a little of both, get a hybrid.
Mountain bikes (MTB) have wide tires, flat bars, and a stout frame. Some have no suspension and are called Hardtails. Others have a suspension fork while some have a full suspension. The full suspension bikes are normally only useful for extremely rugged terrain. Using them on easier terrain just robs you of a little of the energy that you are putting into your pedaling by flexing slightly on every revolution of the pedals. The tires are typically very knobby for traction in dirt and mud.
Road bikes have thin tires, normally drop handlebars but not always, and are usually made of lighter materials. They have no suspension but it is not generally needed on the roads unless you ride in Hamilton, Ohio. The tires have little or no tread.
A hybrid is a cross between these two. It may have either flat or drop handlebars and may have a front suspension. They usually have wider tires than a road bike but not as wide as a true MTB. Often they will have a hybrid tire that has some knobs around the outer edges of the tire but are smooth in the center. Just remember that a hybrid is designed to take care of two very different types of riding, trails and roads. But because of the give and take for each style of riding, they are only going to be able to handle light trail riding and are going to be more difficult to pedal on the road. They are good as a first bike until the rider figures out what kind of riding he prefers.
After you have decided what type of bike you want, go look at what is available at what price in your local shops, on Craig's List, and on eBay. But don't buy a bike just yet, set your budget. Ensure that you budget for a helmet! After you see the prices in the bike shops, you may decide that you need to save a little more before buying a bike or you might realize that you have enough to purchase the bike that you want right now. For those who want to save a little money, the best time to purchase a new bike from a bicycle shop is in October to mid-November. The shop owners are trying to clear out their stock to make room for the next years bicycle models and to save on taxes in states and countries that tax stock. The best time to look for a used bike is after the Christmas holidays when people are getting rid of thier old bikes after receiving a new one for Christmas, or are selling items that they don't use to help pay their Christmas bills.
After you have set your budget and when you have the funds to buy the bike that you want, get fitted. The most important aspect of a bicycle is that it fits you. The most important aspect of a bicycle is that it fits you. The most important aspect of a bicycle is that it fits you. No matter what color the bike is or how cool it looks or what great accessories it has on it, it will be worthless if it doesn't fit. You can get fitted by your local bike shop but this can cost around $100, or you can try out an online fit calculator. Just search "Free Online Fit Calculator" and you will get several possibilities. All you need is a tape measure (I recommend a cloth one like what a dress maker uses. look in your local discount store's sewing department), some paper, and a calculator. And then just follow the directions given. Make sure that you write down your sizes and have it available when you go bike shopping. The most important factor in fitting is the height of the frame measured along the seat tube from the center of the bottom bracket to the top of the seat tube. This measurement cannot be changed. Reach can be altered by getting a shorter or longer stem, and most everything else can be altered by adjusting the saddle height and position.
Then go buy your bike. Visit a variety of different bike shops, ride a bunch of different bikes that are your size, and buy the one that you like best. If you are buying new and the store does not have your size in stock, they may have to order one for you. When dealing with a bicycle shop, be prepared to haggle a little. Many bikes come without pedals or with cheap resin pedals for test rides. If you ride clipless, try to get the shop to discount the pedals that you are going to use and install them on the bike at no charge. Make sure that they throw in a first tune up within the first 30 days as all of the cables will stretch and you will need them adjusted when this happens. If you are a good haggler, you can try to other freebies too.
If you are going to buy used, then a whole different approach is in order. If you are a first time bike buyer, you may want to resist ordering a bike online and stick to the bikes that you can test ride. Check the bike carefully. Look for any signs of heavy damage indicating that the bike was crashed. Inspect the welds carefully to ensure that they are all strong and there are no cracks. Pull out the seat post and look into the frame with a flashlight. Look for any signs of heavy corrosion. Slight corrosion can be taken care of but heavy corrosion can't. Test ride the bike. If you can't test ride it, don't buy it. During the test ride, operate everything to make sure that it all works. Run through every gear to make sure that none of them are too badly worn and are skipping. If the bike skips in every gear, the chain needs replaced, about $50. If it only skips in one gear, then the cassette needs replaced, about $90- $140 depending upon the cassette. In any case, you will probably want to take the used bike to a bike shop to have it tuned up unless you are really handy and want to buy some specialty bicycle tools.If this is the case, there are plenty of online sites that will help you with the tune up procedures, or you can go to your library or book store and pick up a book on bicycle maintenance and repair.
Once you have all of this taken care of, go ride. You should start by riding on street that has little traffic, or in a parking lot during a low traffic period, or on a bike path. You want to do this until you get the feel of the bike and know how to operate everything. If you bought clipless pedals with your bike, you might want to practice clipping in and out in a grassy field until you are comfortable with the procedure.