Formation of methyl esters
Both methods are used in practice (and a a lot more exist). Diazomethane is a last resort method when everything else fails. For example you might have a molecule that is acid sensitive or heat sensitive and then $\ce {MeOH/H^+}$ is out of the question. Although diazomethane is an excellent reagent to do the job, as it works selectively with almost every substrate, to give good yields under mild conditions, generally no extensive work-up or purification are required, it has some major disadvantages: It is not commercially available, it has to be prepared fresh before the reaction using a (somewhat) specialised equipment and a toxic starting material (Diazald). It is explosive and very toxic and obviously can not be stored. An alternative to using diazomethane is TMS diazomethane that is stable enough to be stored as a solution and it is commercially available however it is not innocent at all as this article  shows.