A girl reacts as she tries an iPhone X at the Apple Omotesando store on November 3, 2017 in Tokyo, Japan.

You can avoid this by spending two minutes and making sure your iPhone is automatically set to back up data to iCloud. Here's how.

A family friend recently lost her iPhone. When she went to an Apple Store to buy a replacement, she was met with a surprise: There wasn't a single backup of her earlier iPhones. That meant all of her photos, text messages, apps, email settings were gone, permanently.

Now, when your iPhone is connected to Wi-Fi, is being charged and is locked, it'll save an exact replica of your current phone to the cloud.

That means, if you happen to lose your iPhone and get a new one, you'll only have to log in and select one of your backups to get right back where you were the moment your iPhone was lost.

Note that you get only 5GB of free iCloud storage, which is enough for people who aren't storing that many pictures and messages in the cloud. If you need more, like me, you can upgrade by going to Settings > iCloud > Change Storage Plan. I pay $2.99 per month for 200GB, which is reasonable.