We now study simple models of the universe, and therefore assume both homogeneity and isotropy. As discussed in §Cosmological Principle, homogeneity implies that spacetime is foliated by spacelike hypersurfaces $\Sigma_t$; isotropy implies there are preferred “cosmic observers” orthogonal to these hypersurfaces. Thus, each $\Sigma_t$ represents an instant of time according to these cosmic observers. We can therefore assume without loss of generality that the surfaces are labeled using “cosmic time”, that is, that $t$ is proper time according to these cosmic observers.
The line element therefore takes the form \begin{equation} ds^2 = -dt^2 + h_{ij}\,dx^i\,dx^j \label{metrichi} \end{equation} where $h_{ij}$ are the components of the line element restricted to $\Sigma_t$. There are no cross terms in ($\ref{metrichi}$), since the worldlines of cosmic observers are orthogonal to $\Sigma_t$.
Homogeneity implies that each $\Sigma_t$ has no privileged points; among other things, this means that the curvature must be constant. Thus, each $\Sigma_t$ must be a surface of constant curvature, as discussed in §Constant Curvarture. The line element therefore becomes \begin{equation} ds^2 = -dt^2 + a(t)^2 \left( \frac{dr^2}{1-kr^2} + r^2 \left( d\theta^2 + \sin^2\theta\,d\phi^2 \right) \right) \end{equation} which is known as the Robertson-Walker metric. The free parameters are $k$, which determines the shape of space, and $a(t)$, which determines the scale of the universe as a function of cosmic time. You can think of the universe as the surface of a balloon, whose “radius” is given by $a(t)$, although this analogy is only strictly true for the spherical case ($k=1$), which is illustrated in Figure 1. The parameter $k$ also determines the topology of the universe; the universe is closed (finite) if $k=1$, and open (infinite) otherwise.
It is straightforward to compute the Einstein tensor for the Robertson-Walker metric. As shown in §Robertson-Walker Curvature, the independent, nonzero curvature 2-forms are \begin{align} \Omega^t{}_r &= \frac{\ddot{a}}{a}\sigma^t\wedge \sigma^r \\ \Omega^t{}_\theta &= \frac{\ddot{a}}{a}\sigma^t\wedge \sigma^\theta \\ \Omega^t{}_\phi &= \frac{\ddot{a}}{a}\sigma^t\wedge \sigma^\phi \\ \Omega^r{}_\theta &= \frac{\dot{a}^2+k}{a^2}\sigma^r\wedge\sigma^\theta \\ \Omega^r{}_\phi &= \frac{\dot{a}^2+k}{a^2}\sigma^r\wedge\sigma^\phi \\ \Omega^\theta{}_\phi &= \frac{\dot{a}^2+k}{a^2}\sigma^\theta\wedge\sigma^\phi \end{align} and the nonzero components of the Einstein tensor are \begin{align} G^t{}_t &= -3 \left( \frac{\dot{a}^2+k}{a^2} \right) \\ G^r{}_r = G^\theta{}_\theta = G^\phi{}_\phi &= - \left( \frac{2a\ddot{a}+\dot{a}^2+k}{a^2} \right) \end{align} Thus, the Einstein tensor has precisely the form of the energy-momentum tensor of a perfect fluid! This shouldn't be a surprise, since we have assumed homogeneity and isotropy. Inserting the Einstein tensor into Einstein's equation (with cosmological constant), and assuming the energy-momentum tensor is indeed a perfect fluid, we obtain \begin{align} -3 \left( \frac{\dot{a}^2+k}{a^2} \right) + \Lambda &= -8\pi\rho \\ - \left( \frac{2a\ddot{a}+\dot{a}^2+k}{a^2} \right) + \Lambda &= 8\pi p \end{align} where $\rho$ is the energy density and $p$ the pressure density, and where both of these densities are functions of time $t$.