Turn on airplane mode then turn WiFi back on. That will preclude you from getting phone calls though, unless you have WiFi calling with your carrier.
You might also be able to toggle mobile data off in the quick settings from the notification shade, or in the actual settings menus (where this is varies by manufacturer).