After setting up guest category restrictions for users who are not logged in, guests will not have access to the specified categories. To restrict access to users who are not logged in, go to CATALOG > Catalog Permissions and set Customer Group Category or Product Restriction. You can also add messages and redirect guests to the login page.