Mathematical and numerical modelling of the cardiovascular system is a research topic that has attracted remarkable interest from the mathematical community because of its intrinsic mathematical difficulty and the increasing impact of cardiovascular diseases worldwide. In this review article we will address the two principal components of the cardiovascular system: arterial circulation and heart function. We will systematically describe all aspects of the problem, ranging from data imaging acquisition, stating the basic physical principles, analysing the associated mathematical models that comprise PDE and ODE systems, proposing sound and efficient numerical methods for their approximation, and simulating both benchmark problems and clinically inspired problems. Mathematical modelling itself imposes tremendous challenges, due to the amazing complexity of the cardiocirculatory system, the multiscale nature of the physiological processes involved, and the need to devise computational methods that are stable, reliable and efficient. Critical issues involve filtering the data, identifying the parameters of mathematical models, devising optimal treatments and accounting for uncertainties. For this reason, we will devote the last part of the paper to control and inverse problems, including parameter estimation, uncertainty quantification and the development of reduced-order models that are of paramount importance when solving problems with high complexity, which would otherwise be out of reach.