If you want to hide the list of courses (in categories) from users, you can control this capability:
https://docs.moodle.org/38/en/Capabilities/moodle/category:viewcourselist
I don't know if it's important to you, but take a look at the note (about guest access) at the end of the capability webpage .
These users could see the course they enrolled to, in the course overview block, navigation drawer and etc.