There’s a great summary to your question in the introduction of this article:
Levitt, Malcolm H. "Spectroscopy of light-molecule endofullerenes."
Philosophical Transactions of the Royal Society of London A:
Mathematical, Physical and Engineering Sciences 371.1998 (2013):
20120429.
It’s well worth a read, but I’ll summarize the basic ideas for you since I think it’s behind a paywall.
There are several techniques to get atoms and molecules in to fullerenes (or buckyballs). Note that the nomenclature for endofullerenes is A@C$_n$, where A is the atom or molecule trapped inside the fullerene and $n$ is the number of carbons making up the cage.
Early techniques involve vaporizing carbon and a metal or noble gas, and hoping that a) a fullerene would form, and b) a metal or noble gas would get trapped inside. For this reason, early endofullerenes were metallo-endofullerenes, which were fairly easy to create in low yield by laser vaporizing a metal oxide and graphite composite. This is how La@C$_{82}$ was first synthesized and reported. Fullerenes themselves are often made by a high temperature vaporization of carbon (arc discharge). If you do this in the presence of a metal, you can get metallo-endofullerenes. Some noble gases can be trapped inside a fullerene this way. They’ve actually found He@C$_{60}$ trapped in ancient rocks, which are hypothesized to have been formed before the formation of the Solar System in a similar process. These extreme techniques are limited to metals and noble gases.
Another way to get noble atoms into fullerenes involves heating fullerenes and nobles gases at high pressure. It’s thought that temporary openings in the fullerenes arise, and this allows the noble gases to insert and become trapped. You are limited to noble gases here. Yet another way is to use ion beams to “blast” atoms into the fullerenes. You can get P@C$_{60}$ and N@C$_{60}$ this way.
The above techniques give you low yield, and you are limited to metals and noble gases.
The latest techniques are often called “molecular surgery” and involve chemically creating a hole, or orifice, in a fullerene. The orifice may be enlarged by chemical means, depending on the size of the guest molecule you want to insert. These open-cage endofullerenes, which are relatively stable under mild conditions, are introduced to the guest molecules. Elevated temperature and pressure often helps get the molecules into the cage. Finally the fullerene is closed using chemical methods. In this way, H$_2$O@C$_{60}$ and H$_2$@C$_{60}$ have been made. Just in the past year, HF@C$_{60}$ was made with similar techniques.