To delete an account, first remove all the transactions from that account in the ledger. Next, find the account in the accounts view and after right clicking on the entry to show the popup menu select from the popup menu.
If you are unable to delete an account which looks like it has no transactions in it, check your filter. See → → → . Clear all filters. Set the start date to 1.1.1900 or so.
There may be transactions in your ledger that are not shown, for example, if you have inadvertently typed in the wrong year when making an entry so that an entry remains outside the opening date of KMyMoney. This appears beneath the ledger page as remaining funds.