Observational cosmology in the next decade will rely on probes of the distribution of matter in the redshift range between 0 < z < 3 to elucidate the nature of dark matter and dark energy. In this redshift range, galaxy formation is known to have a significant impact on observables such as two-point correlations of galaxy shapes and positions, altering their amplitude and scale dependence beyond the expected statistical uncertainty of upcoming experiments at separations under 10 Mpc. Successful extraction of information in such a regime thus requires, at the very least, unbiased models for the impact of galaxy formation on the matter distribution, and can benefit from complementary observational priors. This work reviews the current state of the art in the modelling of baryons for cosmology, from numerical methods to approximate analytical prescriptions, and makes recommendations for studies in the next decade, including a discussion of potential probe combinations that can help constrain the role of baryons in cosmological studies. We focus, in particular, on the modelling of the matter power spectrum, P(k, z), as a function of scale and redshift, and of the observables derived from this quantity. This work is the result of a workshop held at the University of Oxford in November of 2018.