Background: There are still many problems of the practical teaching of electrical specialty in colleges and universities, such as the lack of pertinence and innovation in the practical teaching classroom, the inconsistency between the teaching content and the requirements of social practice, which leads to the poor practical operation ability of college students, the poor completion of teaching objectives, and many college students have varied degrees of anxiety. Therefore, exploring the teaching reforms path of electrical experimental course of colleges and universities will help students reduce their anxiety and negative emotions caused by learning, and improve their professional practice ability and mental health level. Subjects and methods: 363 students majoring in electrical engineering were randomly selected from 4 universities and divided into two groups. The control group carried out general electrical experimental teaching, and the experimental group carried out the reformed electrical experimental teaching. The experimental cycle was 2 semesters. 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: By improving the status of experimental courses, optimizing the proportion of experimental projects, and combining simulation software with physical experiments, students' operational ability can be improved and their anxiety psychology can be significantly improved. Conclusions: There are many problems in the teaching of electrical experimental courses in colleges and universities, which lead to students' poor experimental practice ability, affect students' employment and cause students' anxiety. By improving the status of electrical experimental courses, urge students to take this kind of experimental courses seriously and strive to obtain credits. Through the combination of optimized experimental projects, simulation software and physical experiments, we can further exercise students' operation ability, improve students' comprehensive ability and improve students' anxiety psychology.