How to apply authentication to rest endpoint URL? I can access the rest endpoint URL for a node in JSON format (e.g. https://192.168.1.235/rest_endpoint/node/1142?_format=json) even if we are not logged-in to the sever.

Is there any way to apply authentication to access this URL?
Since rest callbacks run through Drupal's normal roles/permissions layer, you can just disable the View published content permission for anonymous users, then they won't be able to fetch the JSON for the View.

If you need finer grained control, you'll have to use hook_node_grants().