This book is devoted to certain aspects of the theory of $p$-adic Hilbert modular forms and moduli spaces of abelian varieties with real multiplication. The theory of $p$-adic modular forms is presented first in the elliptic case, introducing the reader to key ideas of N. M. Katz and J.-P. Serre. It is re-interpreted from a geometric point of view, which is developed to present the rudiments of a similar theory for Hilbert modular forms. The theory of moduli spaces of abelian varieties with real multiplication is presented first very explicitly over the complex numbers. Aspects of the general theory are then exposed, in particular, local deformation theory of abelian varieties in positive characteristic. The arithmetic of $p$-adic Hilbert modular forms and the geometry of moduli spaces of abelian varieties are related. This relation is used to study $q$-expansions of Hilbert modular forms, on the one hand, and stratifications of moduli spaces on the other hand. The book is addressed to graduate students and non-experts. It attempts to provide the necessary background to all concepts exposed in it. It may serve as a textbook for an advanced graduate course.