  Considering a homogeneous and isotropic universe characterized by the
Friedmann-Lema\^itre-Robertson-Walker (FLRW) line element, in this work, we
have prescribed a general formalism for the cosmological solutions when the
equation of state of the cosmic substance follows a general structure $\phi (p,
\rho) = 0$, where $p$, $\rho$ are respectively the pressure and the energy
density of the cosmic substance. Using the general formalism we recover some
well known solutions, namely, when the cosmic substance obeys the linear
equation of state, a Chaplygin type equation of state, or a nonlinear equation
of state. Thus, the current work offers a new technique to solve the
cosmological solutions without any prior relation between $p$ and $\rho$.
