Yesterday I was working on my iPad at home. Stopped to do something, then when I went back to it I went to type something in an email and realised that I couldnt - the keyboard literally didn’t come up! Came out of ‘emails’ and back in and it came up. Tried this in WhatsApp, Messenger, FB, you name it, it does exactly the same for absolutely everything! The first time I go to type anything absolutely nothing happens - I’m just tapping keys for nothing, I have to come out of whatever it is, then go back in and then I can type. And yes I’ve had to do it for this too.
Have you ever had a Bluetooth keyboard connected? If so, it may have reconnected itself. Have a look at Bluetooth under settings to see. Are all your updates done.