Best way to wean baby off breastfeeding?

What is the best way to wean? Or what worked for you? Did you have to replace the comfort of breastfeeding with something else?