After recalling the definition of $Q$-curvature and some applications, we will address the question of prescribing it through a conformal deformation of the metric. We will address some compactness issues, treated via blow-up analysis, and then study the problem, which has variational structure, using a Morse-theoretical approach.