The nonlinear Schrödinger equation in one-dimensional coordinate is investigated numerically by employing explicit and implicit finite difference methods. It is shown that the explicit method is conditionally stable, and the condition for stability, which is a function of the time step and spatial step size, or several grid points are obtained. It is also shown that the implicit scheme is unconditionally stable and results in a tridiagonal matrix at each time level as a function of the nonlinear term. The effects of dispersion and nonlinearity concerning the time and space steps are also investigated. The validity of our scheme is established by reproducing some existing results on the constant-coefficient nonlinear Schrödinger equation. The schemes are then extended to study the variable coefficient equation, which has a growing interest and applications in many areas of nonlinear science.