It depends entirely on the quality you are after, and there is a spectrum from "made at the kitchen table" to "injected in a factory."
Most hobbyists start with clay or Play-Doh, which is cheap but tends to sag or melt into a blob. Paper decals are the other easy route — you are not changing the part, just customising the surface of a minifigure. More committed builders simply cut and reshape existing bricks and pieces, which is crude but effective for small adjustments.
A step up that is genuinely easy: press Plaster of Paris into a master shape to make a mould, then cast the actual part in resin. It is straightforward, the results are clean and durable, and it is the method I use myself.
Real production means injecting hot plastic into metal molds — excellent results, considerable expense, and not something to attempt at home.
Custom parts are a whole cottage industry, and buying is far less time-consuming: