put and get in drupal 8 services code example
Example: drupal 8 get service
// Exmaple, how to get service from container
$entity_type_manager = \Drupal::service('entity_type.manager');
// Exmaple, how to get service from container
$entity_type_manager = \Drupal::service('entity_type.manager');