Regularization works by introducing a penalty term to the loss function used to train the model. This penalty term is controlled by the regularization parameter (λ). By adjusting λ, one can control the trade-off between fitting the training data and keeping the model parameters small. Common types of regularization include L1 regularization (Lasso) and L2 regularization (Ridge).