If you need to unpublish your course, click the Course Status dropdown menu [1]. Then click the Unpublish button [2]. Students who already received course invitations will not be able to access your course.
Once your course contains a graded submission, the course status will no longer display in the sidebar and you will no longer be able to unpublish your course.