Accessing an entity field value

Getting the value of any entity's field

<?php
$entity->get('field_name')->getValue();