This talk offers a pedestrian introduction to particle-in-cell simulations. This simulation technique is very useful in situations in which the distribution function of plasma is not a-priori known, but is needed to infer the efficiency of various physical processes, for example the acceleration and transport of energetic particles in space. In a few examples, I shall illustrate the computational methodology and the main difficulties that one encounters with this simulation technique.