We review the current status and recent progress of microscopic many-body approaches and phenomenological models, which are employed to construct the equation of state of neutron stars. The equation of state is relevant for the description of their structure and dynamical properties, and it rules also the dynamics of core-collapse supernovae and binary neutron star mergers. We describe neutron star matter assuming that the main degrees of freedom are nucleons and hyperons, disregarding the appearance of quark matter. We compare the theoretical predictions of the different equation-of-state models with the currently available data coming from both terrestrial laboratory experiments and recent astrophysical observations. We also analyse the importance of the nuclear strong interaction and equation of state for the cooling properties of neutron stars. We discuss the main open challenges in the description of the equation of state, mainly focusing on the limits of the different many-body techniques, the so-called hyperon puzzle, and the dependence of the direct URCA processes on the equation of state.