The first and most important step to make your bike actually fitted on you, is buying a frame of your size. Today, almost all the main companies do not produces custom-cut frames anymore, but sell about 3-4 sizes on which you can build your customized components. For this reason, once you have picked out your right frame size, you will assemble the components (stem, handlebar, cranks, steerer tub, saddle...) to obtain an overall bike geometry fitted to you. Of course, if you are going to buy a tour bicycle this step should be done by your shopkeeper who will fit the components to your size. The problem is about a second-hand or given bicycle, that you want to adjust without spending hundreds euros in a specialist consulting.
Adjust the height
There is not a direct correlation between your height and the frame size since anyone has a different anatomy. Some people have long legs and a compact bust, others have short legs and long arms, or long legs and arms, etc.... so I can give you general indications only. Considering the frame size in inches, the 14-16 is suitable for a person shorter than 1,60 m., 16-18 for those around 1,70 m. and 18-20 for people around 1,80 m.
Once you have chosen the frame, the other components involved in the seat position are basically three: the saddle, adjustable in height, tilt and declivity; the handlebar, adjustable in height and declivity through the stem that connects it to the fork; and then the crank arms. If yours is a second-hand bike and you don't want to replace any components, the best thing is adjusting the saddle. We can regulate its height by loosening the screw that secures the steerer tube to the frame. To determine the right position you can make a simple test: put on the shoes you are going to use for your rides. Then saddle up and place your heel on the pedal. Helped by a friend try pedaling backwards until the point in which the cranks is down and parallel to the vertical tube of the frame. In this position, your legs must be completely stretched but without muscle tension. After adjusted the saddle height, keep pedaling backwards, if you notice the stretching is not complete, raise the saddle; on the contrary, if your hips swing while pedaling, lower the saddle. Basically, the saddle must be adjusted in a horizontal position and perpendicular to the ground, but to feel a little more comfortable in uphill rides you can slightly tilt the saddle forward, being in mind that you will feel a little uncomfortable downhill.
Adjust the lenght
Now you have to focus on the length of your bicycle. Here I'll try to give you some empirical notions about positioning: we could act on the saddle moving it forward or backward by adjusting the screws below. Another possibility to adjust the length between saddle and handlebar is the stem replacement, since there are many different sizes on the market. To evaluate the moving position, sit in the saddle and grab the handlebar. In principle, by looking down to the front wheel you should see the hub slightly over the line of the handlebar. Elbows should be slightly inclined while grabbing the handlebar but without feeling slouchy in the saddle or too high in the saddle. Further adjustments can be made by inserting a thikness under the stem junction to lift the handlebar, or in the length of crank arms where pedals are fixed.
However, practice is much more important than any word, and particularly the “feeling” you create with your vehicle: after the adjustments, go run for some kilometers and you'll immediately notice if you have improved or worsen your sensations and comfort. If you have some medical problems such as chronic backaches, sciatica and others and you don't want to give up this wonderful sport, namely mountain biking, go consult an expert who will suggest you the best solution to continue your MTB experience.