If you need to unpublish your course, click the Unpublish button in the sidebar. Students who already received course invitations will not be able to access your course.
Once your course contains a graded submission, you can no longer unpublish your course.