The goal of these lectures is to present the few fundamentals of noncommutative geometry looking around its spectral approach. Strongly motivated by physics, in particular by relativity and quantum mechanics, Chamseddine and Connes have defined an action based on spectral considerations, the so-called spectral action.The idea here is to review the necessary tools which are behind this spectral action to be able to compute it first in the case of Riemannian manifolds (Einstein-Hilbert action). Then, all primary objects defined for manifolds will be generalized to reach the level of noncommutative geometry via spectral triples, with the concrete analysis of the noncommutative torus which is a deformation of the ordinary one.The basics of different ingredients will be presented and studied like, Dirac operators, heat equation asymptotics, zeta functions and then, how to get within the framework of operators on Hilbert spaces, the notion of noncommutative residue, Dixmier trace, pseudodifferential operators etc. These notions are appropriate in noncommutative geometry to tackle the case where the space is swapped with an algebra like for instance the noncommutative torus.