To hide specific courses, we can use course id’s in a comma separated list in the course module’s settings. We can also hide courses that the user has no access to.
The course id is the id found on the address bar of your browser when editing a course: