We present the basic principles of exact diagonalization and (dynamical) density-matrix renormalization-group approaches to the calculation of ground state and dynamical properties in electron-phonon systems.