There's a somewhat hidden feature in iOS called WiFi Calling, which lets you use WiFi to make and receive calls and text messages.
WiFi Calling is great when your iPhone is out of reach of your carrier's cell signal.
The feature isn't turned on by default, so you have to go into your iPhone's settings to turn it on. Go to Settings > Phone > WiFi Calling, and turn on the WiFi calling setting.
Then, you'll be asked to enter your address to register WiFi calling with your carrier. This is mainly done so emergency services can come to the address you provided in case they can't locate you with a cell signal.
After a couple of minutes, WiFi calling will be enabled and you can start using your home's WiFi connection to make calls and/or send and receive text messages.
With WiFi calling, you can even set up other iCloud-connected devices to make WiFi phone calls and send texts, like your iPad, iPod, and Mac computers. They don't need to be connected to the WiFi network your iPhone is connected to.