The ultracold atomic Fermi gas provides a flexible and controllable experimental platform for exploring magnetic impurity states. In this study, we theoretically examine the magnetic impurity states in a Fermi system with spin-1/2 and spin-3/2 under a local magnetic field. Firstly, the spin-1/2 impurity system contains three types of magnetic solutions. One type magnetic solution with higher energy can be regarded as the result of induced magnetization of a trivial solution, while the other two types magnetic solutions with lower energy can be understood as the results of Zeeman splitting of nontrivial solutions with double degeneracy. Notably, the magnetic solution corresponding to the spin state parallel to the Zeeman magnetic field is always the most stable in terms of the energy. Secondly, we extend the idea of studying spin-1/2 impurity to spin-3/2 impurity, where the half-filled state of impurity atoms is calculated. We found that four types of magnetic solutions at zero magnetic field were split into four, six, four, and twelve new magnetic solutions in the presence of a Zeeman magnetic field, respectively. We obtained that the magnetic solution corresponding to the spin state parallel to the magnetic field is the most stable, and its energy is lower than that of the corresponding magnetic solution at zero magnetic field. Therefore, the introduction of a local magnetic field is beneficial for the formation of magnetic impurity states. Finally, the calculated data illustrate that the Anderson impurity model we adopt exhibits invariance under the combined transformations of spin-flip and particle–hole.