You can un-publish your course at any point of time. To un-publish a published course go to Courses in admin dashboard. Select the published course which you would like to un-publish. Click on Unpublish button in the course builder page. Click on confirmation popup to unpublish.
In settings page click on unpublish button. If there are students enrolled you cannot unpublish course. You first have to disable all the students enrolled to that course and then click on unpublish again.