Buying a used phone mostly comes with used Gmail Account in the Android phone and it is better to Remove the Gmail Account From Device to put yours and remove all the information the person has in the Android device. Some usually Factory Reset the phone to Remove Gmail Account, but that's not what you'll be doing after this tutorial.
You and I can easily just remove the Gmail Account without even Restoring the device to Factory Reset. In fact, it is recommended you don't Factory rest, Why? Doing so can make the Android Phone Locked to Google Login and you'll have to input the Gmail Account username and password which obviously, you wouldn't know, making the issue complicated. Anyway, if that's the case, there is a tutorial coming up to bypass that.
How To Remove Gmail/Google Account From Android Without Factory Reset
I have screenshots of how I did this on my Android Device that isn't even rooted. Make sure you follow the tutorial.