Like Drupal 7, there are still the t() and format_plural() functions. However, the functionality behind these relies on the TranslationManager class. This means that it can be dependency injected into any Drupal 8 services, controllers, plugins, and so on. This is the preferred mechanism for translating text in PHP, and many base plugin classes in Drupal already implement functions that delegate to the TranslationManager.
One thing to be aware of is that the mechanism that discovers translatable strings relies on the functions being called, named t() and formatPlural(). So, while the actual method to translate content is TranslationManager::translate(), the following will not be picked up by localize.drupal.org:
$this->stringTranslation->translate('Something');
In addition to the function names, using variables in calls to the translation functions also prevents the strings from being discovered. So, writing code like this:
t($variable) $this->t($first . ' word ' . $last);
Will prevent it from being able to be extracted and translated by the community. If you need to use a variable, you should use variable substitution, like this:
$this->t('@first word @last', [ '@first' => $first, '@last' => $last ]);