An ester is the condensation product of an alcohol and an acid. This means that one molecule of acid and one molecule of alcohol combine to form one molecule of ester + one molecule of water. Typically the acid is a carboxylic acid, but there are also some esters based on inorganic acid moieties such as phosphate and sulfonate esters. The alcohol can also be replaced by a thiol to form a thioester.1
The best known esterification reaction is called Fischer esterification. Acid catalyzes this reaction. If you would like to draw the mechanism, I will quickly describe it for you.
1) Protonate the carbonyl group of the carboxylic acid.
2) Nucleophilic attack on the carbonyl by the alcohol to form a tetrahedral intermediate.
3) Proton transfer from the alcohol to one of the two hydroxyl groups in the tetrahedral intermediate.
4) Reformation of the carbonyl with expulsion of water as a leaving group.
5) Deprotonation of the carbonyl (upon workup).
Note that Fischer esterification is a reversible reaction; it is driven to form products by use of a large excess of the alcohol. This usually means using the alcohol in question as the reaction solvent. The alcohol does not have to be methanol. One could use ethanol, isopropanol, butanol, etc.
Hope this clears things up for you.