How to delete attribute group by id Magento 2?

You can remove the attribute group by the group id in Magento 2.

You can see a list of attribute groups from the Stores -> Attribute -> Attribute Set -> Click on Any attribute set.

Remove Attribute Group Record by the delete method with group id as an argument in the ProductAttributeGroupRepositoryInterface.

Now Call the method,
echo $isRemoveAttributeGroupSuccess = $this->removeAttributeGroup();