You can use this approach.
/**
* Implements hook_field_widget_form_alter().
*/
function insights_analyst_field_widget_form_alter(&$element, FormStateInterface $form_state, $context) {
if($element['#field_name'] == 'field_figure'){
$element['#process'][] = 'removeFile';
}
}
function removeFile(&$element , \Drupal\Core\Form\FormStateInterface $form_state, &$complete_form){
$element['remove_button']['#submit'][] = 'markupRemove';
return $element;
}
function markupRemove($form , \Drupal\Core\Form\FormStateInterface $form_state){
$parents = $form_state->getTriggeringElement()['#array_parents'];
$button_key = array_pop($parents);
//print_r($button_key);
if($button_key == 'remove_button'){
//Write your logic here
}
}