I will split up my talk up into two parts. In the first part I will talk about how we can use the post-Newtonian formalism (within general relativity) to construct a bottom-up approach to cosmology to study the effect of small-scale inhomogeneities on the large-scale expansion. In this approach, we also extend the post-Newtonian formalism to include other forms of matter that are cosmologically relevant such as radiation and a cosmological constant. In second part of my talk I will generalise this bottom up approach to create a parametrization that can be used to test a large class of theories of gravity on cosmological scales in the weak field limit. We do not assume any set of field equations from the outset. The advantage of this parametrisation is that it requires only four functions of time. These four functions can be linked directly to the background cosmological expansion as well as the growth of structure. I will give a couple of specific examples where we have applied this formalism. We have applied it to scalar-tensor and vector-tensor theories of gravity.