How to Block or Ban Access to Node or Node/xxx in Drupal 8 Programmatically in PHP

Drupal is a CMS (Content Management System) made up of a number of nodes of different types. Each node represents information of one type. Some times it is necessary to block or ban or restrict access to a node in Drupal 8. Using this Drupal tutorial, you can programmatically block access to node using PHP language.