Am i safe to reset my iphone?

Greetings, i have recently purchased an iphone that had no password but the owner forgot to clear the phone and log out of the apple id.

i took it upon myself to log them out.

now the question is. Am i safe to reset the phone or will it ask me for an apple ID (their apple ID) when i reset it?

When you reset it, this phone ask for apple ID. So you should try to other option and if you still facing the problem then you should contact to Apple's customer care.
Hope you understand…

Nope. If you full reset it to factory default settings, it wil ask for an Apple ID, And not the apple ID of the previous owner.