How to get a customer by his ID?

Method 1. \Magento\Customer\Model\CustomerRegistry::retrieve()

The method returns an instance of the \Magento\Customer\Model\Customer if the customer has been found, and throws a \Magento\Framework\Exception\NoSuchEntityException exception if the customer has not been found.

Method 2. \Magento\Customer\Api\CustomerRepositoryInterface::getById()

The method returns an instance of the \Magento\Customer\Api\Data\CustomerInterface if the customer has been found, and throws a \Magento\Framework\Exception\NoSuchEntityException exception if the customer has not been found.
It uses the Method 1 in its implementation: