How can I unpublish a course?
The "Publish"/"Unpublish" is a toggle setting in the upper right corner of the course home page. See this article for screenshots:How do I publish a course?
I will add to Michael Zimmerman 's excellent advice that once you have graded student submissions in a course, you can no longer unpublish it. This makes sense because student submissions and grades for those submissions will fall under most, if not all, state record retention rules.
Typically, user access to past courses is managed using other tools in Canvas. Most schools manage this through how they set up Terms. You can learn more at How do term dates, course dates, and section dates work in Canvas?
Retrieving data ...