You can expire the roles for all users in the course. For example, when you use Add/Modify a Student or Add/Modify a Course User to put students or Course Coordinators into a course, you can set an ending date for those roles. When the ending date is reached, the role associated with the course will not be accessible to the user any more.
If you view the User Roles screen, you will see a checkbox at the
top that allows you to display all roles. If you check that box and
It is a good idea to get into the habit of setting end dates for all courses.