First you should open the Settings app and go to “iCloud”
Then scroll down under all the settings to find “Delete Account” (or “Sign Out”) and tap on that
Finally confirm the removal of the iCloud account from the device by tapping on “Delete” or “Sign Out”