Don't bother writing the software unless you're doing it for your own edification; MATLAB already has a Distribution Fitter tool built in (https://www.mathworks.com/help/stats/distributionfitter.html).
Standard approach? Novices pray the data is normally distributed, and check with histograms, Q-Q plots, and goodness-of-fit tests. And if it's not, they apply rules of thumb or a Box-Cox transformation to beat the data into submission.
Statisticians with a "feel for phenomena" consider the process being modeled, and narrow their search down to something appropriate. For example, lifetime or time-to-event data is usually modeled with exponential, gamma, weibull, or lognormal distributions (and some other more exotic ones).
A humble statistician goes to the source of the data, the researcher who collected it and has the best insight into the process being measured. The engineer, or chemist, or cancer researcher probably doesn't know the names of the all the distributions used to analyze their problems, but they can get you into the appropriate literature, and suggest folks who've studied similar problems.