To create a molecule from scratch, you would study organic chemistry. Nearly all of the molecules we're interested in are organic, which means that they contain carbon. A small quantity of a molecule can be made in a synthetic chemistry lab, but if you want tons, then the process has to be scaled up to the scale of a chemical plant. Often the things that work in the lab don't work at very large scale, and need to be changed. Large scale syntheses are developed by process chemists, and the plants are built and operated by chemical engineers.
There are contract labs that will make anything for a price. Many of these are in China. Usually they work at the gram to kilogram scale, but some can do larger amounts.
Many molecules used as supplements are extracted from plant materials. This involves treating the plant material with a solvent that dissolves the compound of interest. (The words "compound" and "molecule" are interchangeable for our purposes.) The solvent might be a traditional solvent like alcohol or hexane, or it might be steam or high pressure CO2.
Some compounds are made by microbes, which might have been genetically engineered to produce the compound. They are grown in giant fermentation tanks, and the compound is recovered from the growth medium or microbe.
If you want to make your own supplement, you can buy raw materials in bulk from various providers, then take them to a contract service that will cap, bottle, and label them. This is pretty easy to do, and explains the profusion of crappy supplements on the market, many of which are aimed at the bodybuilding community.