This book grew out of a graduate course at ETH Zurich during the spring 2011 term. It explores various links between such notions as occupation times of Markov chains, Gaussian free fields, Poisson point processes of Markovian loops, and random interlacements, which have been the object of intensive research over the last few years. These notions are developed in the convenient setup of finite weighted graphs endowed with killing measures. This book first discusses elements of continuous-time Markov chains, Dirichlet forms, potential theory, together with some consequences for Gaussian free fields. Next, isomorphism theorems and generalized Ray-Knight theorems, which relate occupation times of Markov chains to Gaussian free fields, are presented. Markovian loops are constructed and some of their key properties derived.