How to remove your old Account from the iPhone (iOS 11 and newer)

View your Accounts

Tap Settings > Accounts and Passwords

Tap the account you want to remove

Delete the Account

Verify that you are on the correct account

Push up on the screen until you see the Delete Account option.

Tap Delete Account