How to delete block on hook_uninstall?
Yes, then the best thing would be to follow the enforced config dependencies part above, if you create the content blocks with a fixed uuid then you can just put the block config entities in your config/install folder, with the config dependencies as explained there and it should be uninstalled automatically.

At least the config entities, if you want to delete the block_content entities too then load them by UUID with $block_content = \Drupal::service('entity.repository')-&gt;loadEntityByUuid('block_content', 'YOUR_UUID'); $block_content-&gt;delete()