Monte Carlo methods play an important role in scientific computation, especially when problems have a vast phase space. In this lecture an introduction to the Monte Carlo method is given. Concepts such as Markov chains, detailed balance, critical slowing down, and ergodicity, as well as the Metropolis algorithm are explained. The Monte Carlo method is illustrated by numerically studying the critical behavior of the two-dimensional Ising ferromagnet using finite-size scaling methods. In addition, advanced Monte Carlo methods are described (e.g., the Wolff cluster algorithm and parallel tempering Monte Carlo) and illustrated with nontrivial models from the physics of glassy systems. Finally, we outline an approach to study rare events using a Monte Carlo sampling with a guiding function.