Assuming that you have an Android Telephone, you link a Google phone account as are described here ' And you want to sell your phone, for example, or you want to cancel the account and put another account or whatever the reasons
1-Open the Settings> Privacy As the picture.

2-Select (Factory data reset) and follow the next step.

Select Reset phone to clear the account and education can Format USB storage to clear the phone's internal memory completely.
Note: If your phone without internal memory such as mobile in Primary category you will not find this option.
