The necessary condition of generating optical pumping signals in optical pumped magnetic resonance experiment is that the horizontal magnetic fields including the scanning magnetic field,horizontal static magnetic field and horizontal geomagnetic field can achieve the zero. In addition,the direction of geomagnetic field is fixed,and the direction of scanning magnetic field and horizontal static magnetic field has four possible combinations. According to these facts,the paper proposes a quick method for determining the direction of scanning magnetic field and horizontal static magnetic field. The key point of this method is when the direction of scanning magnetic field and horizontal static magnetic field coincides with that of horizontal geomagnetic field,it cannot generate optical pumping signals because the horizontal magnetic fields cannot achieve the zero. Otherwise,the optical pumping signals can be obtained by adjusting the scanning magnetic field and horizontal static magnetic field. This method not only can simultaneously,quickly and accurately determine the direction of two magnetic fields,but also can deepen the understanding of the physical mechanism of generating optical pumping signal for the students.