This article explains how to back up all your data, such as accounts, documents, custom settings, and text messages, to iCloud or iTunes using an iPhone.
Steps
Method 1 of 2: Backup to iCloud

Step 1. Open the iPhone "Settings" application
Search and tap the icon
on the home screen or in a folder.

Step 2. Tap your name at the top of the screen
Your full name and Apple ID picture appear at the top of the "Settings" menu. Tapping it will open your Apple ID menu.

Step 3. Tap iCloud on the menu
This option appears next to the icon

on your Apple ID menu. Allows you to open iCloud settings.

Step 4. Scroll down and tap iCloud Backup
The options associated with the backup will open.

Step 5. Swipe the iCloud Backup button to activate it
When this option is enabled, the iPhone automatically backs up all data to iCloud. You will need to confirm this action in a pop-up window.
For automatic backup, the iPhone must be plugged in, with screen lock and connected to Wi-Fi

Step 6. Tap Ok on the confirmation pop-up window
A button with the blue "Back up now" will appear on the backup menu.

Step 7. Tap the blue Back Up Now button
This will start backing up all your data to iCloud. All your text messages, documents and settings will be backed up.
Method 2 of 2: Backup to Computer

Step 1. Connect your iPhone to the computer
You can use the charging cable to connect it via USB.

Step 2. Open iTunes on your computer
The icon looks like a blue and pink music note in a white circle. You can find it in the "Applications" folder on a Mac or in the "Start" menu on Windows.
If this is your first time connecting your iPhone to your computer, tap "Authorize" on the mobile screen to consent to the connection

Step 3. Click on the phone icon in iTunes
This button is located below the play button, top left. Allows you to open the iPhone navigation panel on the left side.
If you don't see the "Summary" tab when you open it, click on it at the top of the panel on the left. This tab shows your phone's hardware, storage space, and backup information

Step 4. Select This Computer in the "Backup" section
In the "Summary" tab look for the "Backup" section and make sure "This computer" is selected under the "Automatic backup" heading.

Step 5. Click the Back Up Now button
Under the heading "Manual Backup and Restore", click this button to backup your data to your computer. All text messages will be backed up, as well as documents and settings.