For a used iPhone, ask the original owner to enter their credentials, sign out of iCloud ... Apple Account on iOS 11 or later ...