In order to be self-contained, the book includes three chapters of preliminary material, each of which can be used as an independent course if needed. The first chapter deals with metric properties, variational principles, decrease principles, methods of error bounds, calmness and metric regularity. The second one presents the classical tools of differential calculus and includes a section about the calculus of variations. The third contains a clear exposition of convex analysis.