Symfony comes packed with a lot of useful classes and functionalities, called . These are used for rendering templates, sending emails, querying the database and any other "work" you can think of.
If you need a service in a controller, type-hint an argument with its class (or interface) name. Symfony will automatically pass you the service you need:
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Response;
public function homeAction(Post $post, LoggerInterface $logger)
{
$logger->info('We are logging!');
// ...
}