How to factory reset iPhone when I bought it of someone else?

Ok o bought a iPhone 5s from someone and they forgot to sign out their apple id and I want to reset the iPhone to factory reset but it won't let me because I have to turn off their apple I'd and signout any way around this

Ask the original owner to sign out. If they don't want to, then you were just scammed.

Only that person can do it. So email them and ask. No way around the iCloud activation lock. If the person doesn't reply then they are rude or you were ripped off. Apple will not do third party drama and doesn't get involved. Best luck.