The person that gave you the iPhone should have restored it to factory settings. If that were the case, turning it on, should prompt you with a "Hello" screen, and from there, it's just a matter of following the on-screen prompts to set it up.

click here ➜ Set up your iPhone or iPad - Apple Support
If you see a different screen, then please explain what you see. If you see the Home Screen with the Apps, then the previous owner did not correctly restore it. Tell him to follow the steps in the support document linked below.
click here ➜ What to do before you sell, give away, or trade in your iPhone or iPad - Apple Support