If you have an iPhone 6 or earlier, you can't erase all content and settings. To erase all content and settings, you need an iPhone 7 or later.