If you actually know your correct passcode, you can wait until you're given the opportunity to enter the correct passcode. Otherwise, you cannot change your passcode from a trusted device and you MUST follow the directions in the related article link at the top of this page. Assuming you've been backing up your iPhone, you'll be able to restore your most recent backup after you erase your iPhone. If you haven't backed up your data, your data will be gone.
It should NOT be easy to just change a passcode if the wrong passcode was entered too many times. It would be too easy for a thief to then wipe the phone for their own use.