Determine if an entity is a certain content type
You should be able to check the entity type and content type like this:
use Drupal\Core\Entity\EntityInterface;

function hook_entity_presave(EntityInterface $entity) {
  if($entity-&gt;getEntityTypeId() == 'my_entity_type' &amp;&amp; $entity-&gt;bundle() == 'my_content_type') {
    // Do your stuff here
  }
}

Where my_entity_type is the entity type and my_content_type is the content type.
Adding Clive's answer, since the entity type you want to work with is already known to be a node, you can use hook_node_presave() instead of hook_entity_presave:
use Drupal\Core\Entity\EntityInterface;

function hook_entity_presave(EntityInterface $node) {
  if($node-&gt;bundle() == 'my_content_type') {
    // Do your stuff here
  }
}