We prove a boundary Harnack principle in Lipschitz domains with small constant for fully nonlinear and $p$-Laplace type equations with a right hand side, as well as for the Laplace equation on nontangentially accessible domains under extra conditions. The approach is completely new and gives a systematic approach for proving similar results for a variety of equations and geometries.