  To describe the scattering of superconducting quasiparticles from
non-magnetic (Zn) or magnetic (Ni) impurities in optimally doped high T$_c$
cuprates, we propose an effective Anderson model Hamiltonian of a localized
electron hybridizing with $d_{x^2-y^2}$-wave BCS type superconducting
quasiparticles with an attractive scalar potential at the impurity site. Due to
the strong local antiferromagnetic couplings between the original Cu ions and
their nearest neighbors, the localized electron in the Ni-doped materials is
assumed to be on the impurity sites, while in the Zn-doped materials the
localized electron is distributed over the four nearest neighbor sites of the
impurities with a dominant $d_{x^2-y^2}$ symmetric form of the wave function.
With Ni impurities, two resonant states are formed above the Fermi level in the
local density of states at the impurity site, while for Zn impurities a sharp
resonant peak below the Fermi level dominates in the local density of states at
the Zn site, accompanied by a small and broad resonant state above the Fermi
level mainly induced by the potential scattering. In both cases, there are no
Kondo screening effects. The local density of states and their spatial
distribution at the dominant resonant energy around the substituted impurities
are calculated for both cases, and they are in good agreement with the
experimental results of scanning tunneling microscopy in
Bi$_2$Sr$_2$CaCu$_2$O$_{8+\delta}$ with Zn or Ni impurities, respectively.
