Sub-Riemannian geometry can be seen as a generalization of Riemannian geometry under non-holonomic constraints. From the theoretical point of view, sub-Riemannian geometry is the geometry underlying the theory of hypoelliptic operators. In applications it appears in the study of many mechanical problems (robotics, cars with trailers, etc.) and recently in modern fields of research such as mathematical models of human behaviour, quantum control, motion of self-propulsed micro-organism, cognitive neuroscience. In this talk I would like to introduce the notion of sub-Riemannian manifold, discussing the major differences between the Riemannian case, both from the geometric and analytic viewpoint. In particular, after an introduction on the basic properties of these structures, I will discuss some results about the interplay between the geometry of these spaces (geodesics, curvature...) and the solution of the heat equation.