Hello javaid99,
Thank you for using Apple Support Communities. Sounds like you're unable to update your iPhone via the Settings menu. If so, we'd like to help recommend some steps to troubleshoot this issue and get you updated. There's various reasons why this issue might occur. For steps that you can try on your own, please click here and follow the listed steps: If your iPhone or iPad won't update - Apple Support
Check these steps as well:
1.) Make sure you're not using a VPN: If your iPhone or iPad won't update - Apple Support
2.) Remove any configuration profile that might be installed: Install or remove configuration profiles on iPhone - Apple Support
3.) Try connecting to a different reliable Wi-Fi network.
4.) Update using a computer:
-Update your iPhone, iPad, or iPod touch with the Finder - Apple Support
-Update software on iPhone, iPad, or iPod touch in iTunes on PC - Apple Support
We hope these steps help you. Thank you for using Apple Support Communities. Take care.