Subaccounts: If the account has subaccounts, either move the subaccounts to another parent account, or delete the subaccounts before you delete the parent account.
Merging accounts: Consider merging the account with another account instead of deleting it (before deleting the account, you would have to reassign all the transactions that post to the account).