The Private Site feature that you can enable in Members → Settings → General tab allows you to make sure that only logged-in users can see anything on your site. If a user visits your site and is not logged in, they are immediately redirected to your wp-login.php
(WordPress login) page.
You can also enable option that require authentication for access to the REST API and the option for disabling the viewing of feed content and setting an error message for feed items.