Background: There are still some problems of the teaching of ideological and political education in colleges and universities. For example, the teaching mode of ideological and political education in colleges and universities is backwatd and does not play an educational role, which aggravates the employment anxiety of students. Research on taking employment as the direction of reform and innovation of ideological and political Education, in order to provide targeted guidance and education for students' employment anxiety and alleviate students' employment anxiety. Subjects and methods: 310 college students were randomly selected and divided into experimental group and control group. The two groups carried out general ideological and political education and employment oriented ideological and political education respectively. The experimental cycle was 1 semester. After the experiment, the anxiety psychology of college students was detected by Hamilton Anxiety Scale (HAMA), and the anxiety psychology of students was evaluated by random forest algorithm. Results: Reform ideological and political education and build a content system for ideological and political education to promote employment, and the targeted guidance and education on the employment problems of college students have significantly alleviated the employment anxiety of students and significantly improved the mental health level of students. Conclusions: Facing the pressure brought by the employment situation, college students have employment anxiety. The ideological and political education in colleges and universities carries out reform guided by employment, constructs the content system of ideological and political education to promote employment, improves the professional level of employment guidance personnel, and alleviates the employment anxiety of college students.