This lecture covers the use of molecular dynamics for sampling, including the generation of trajectories using Hamilton's equations, conservation laws, and the necessary conditions for detailed balance. It also discusses integrating the equations of motion, monitoring energy fluctuations, and the conservation of energy in Hamiltonian MD. The instructor explains constant-temperature molecular dynamics, the use of thermostats like Andersen thermostat, and the distinction between global and local thermostats. Additionally, deterministic and stochastic thermostats such as Nosé-Hoover and Langevin-style thermostats are presented, along with their characteristics and applications.