In-degree tracks readiness. Each course starts with an in-degree equal to its number of prerequisites. When in-degree reaches , all prerequisites are complete and the course is ready to take.
You push all courses with in-degree into a queue. Each time you pop a course, you "take" it and remove its outgoing edges. This decreases the in-degree of dependent courses. When a dependent course's in-degree drops to , it enters the queue.
If you process all courses, you have a valid schedule. If some courses remain with in-degree , those courses form a cycle and the schedule is impossible.