use Drupal\Core\Entity\EntityInterface;`
function hook_entity_presave(EntityInterface $entity) {
if($entity->getEntityTypeId() == 'my_entity_type' && $entity->bundle() == 'my_content_type') {
// Do your stuff here
}
}
https://drupal.stackexchange.com/questions/228563/determine-if-an-entity-is-a-certain-content-type