Text this: A study of relativistic fluids with applications to cosmology: A variational approach