Uninstalling a created custom module in drupal 8
See How to delete a content type, programmatically?

You can add enforced dependencies on any config entity, if you do so, drupal will automatically remove them.

That's much better then using hook_uninstall(), as the user is informed about what will be removed on the uninstall confirm page.