Welcome to the Apple Support Communities. I see you're curious about recovering access to a device that's locked, and I'd be happy to clear things up for you. When it comes to unlocking a device or resetting it because the passcode was forgotten, the only way you can is through iTunes on a computer. This article has the details: If you forgot the passcode for your iPhone, iPad, or iPod touch, or your device is disabled - Apple Support
The good news is: so long as you have access to a Mac running at least OS X Yosemite, or a PC with Windows 7 or later, you can download iTunes at no cost. Here's where: iTunes - Download iTunes Now - Apple
If you don't have a computer, or your computer doesn't/can't meet the requirements, you'll need to see about using someone else's computer. If that's not possible, make an appointment with your local Apple Store so they can use on-site equipment to help you reset the iPhone. Cheers!