An Introduction to Flow Matching and Diffusion Models