I have upgraded a website to drupal 8 that I found a field created and I need to delete that field as it becomes useless.

**Problem**:
The field becomes locked which prevents me delete it from the interface.
I tried to delete it in code programmatically using [field_purge_field][1] BUt it didn't work.

**Motivation**:
Edit the field settings to unlock and delete from the interface or delete it using field api.

The answer on that question didn't work as I need to catch one field and delete it [how-to-properly-delete-fields-programmatically][2]

Can any body provide an example to unlock the field or delete it using its machine name?

Thanks in advance


  [1]: https://api.drupal.org/api/drupal/core%21modules%21field%21field.purge.inc/function/field_purge_field/8.2.x
  [2]: http://drupal.stackexchange.com/questions/177156/how-to-properly-delete-fields-programmatically