You would buy the miles from the airline just like anything else you buy. There have been threads here in the past with the cost, I don't remember it off the top of my head. We use miles as an incentive here, and I believe we are in the two point two cents per mile range.
We upload a spreadsheet with the person's name, AAdvantage account number, and number of miles, and American transfers them into their account. I believe you can also purchase certificates for say 500 or 1000 miles the prople can fill out and mail into the airline.
For more details on the American program (it's what we use, I assume others are probably similar) visit
https://www.orderaamiles.com/orderAA...derAAmiles.htm
Full pricing and all the options are there.