There are two ways to update your iPhone.
Via WiFi : Make sure your iPhone is connected to Wifi .
Go to settings > General . Software Update. It will look for latest updates and would update your iPhone. Ensure your phone has atleast 50% of charge or is connected to the power.
Via Cable :Open iTunes. Connect your iPhone. Select Trust on your Device and then enter your passcode. Then Click on Update iPhone. This will download the latest the Software and update your iPhone.
This does not delete your Data but it is advisable to take a backup of your iPhone before you do this.