Welcome!
You have found the English-language version Apple’s user-to-user communities. If you can post future questions in English, you will reach a much larger audience and get faster help, with far less chance of our making a translation error. Not all users here have auto-translate capability on their devices.
MACHINE TRANSLATION:
Hello, I bought a used iPhone from a friend, and it seemed that everything went well. I reset the iCloud settings and decided to reset the data on the phone, but when I tried to set up the phone after resetting, the error "failed to activate" appeared. What should I do?
RESPONSE:
Have your friend properly prepare the phone for sale, or get your money back. Only your friend a reset it. Apple cannot. You cannot use the phone as is.
Apple reference: What to do before you sell, give away, or trade in your iPhone or iPad - Apple Support
MACHINE TRANSLATION of RESPONSE:
Попросите вашего друга правильно подготовить телефон к продаже или вернуть вам деньги. Только твой друг сбросил его. Apple не может. Вы не можете использовать телефон как есть.
Ссылка на Apple: What to do before you sell, give away, or trade in your iPhone or iPad - Apple Support