The essence of in-class ideological and political education is to integrate Chinese traditional culture, socialist core values and Marxism into teaching, and turn the classroom into the main position of imparting knowledge and cultivating morality. Taking the Cost Accounting course in application-oriented undergraduate colleges and universities as an example, this paper analyzes the importance and existing problems of ideological and political education in Cost Accounting, and puts forward some methods to improve ideological and political education, such as changing the original teaching mode and improving teachers' own moral quality, so as to improve students' ideological and moral quality.