If your iPad keeps going to sleep while you’re using it, there are a few things you can check:
Make sure that Auto-Lock is turned off. Go to Settings > Display & Brightness and make sure that the Auto-Lock slider is set to Never.
Check your brightness settings. If your iPad’s screen is too bright, it may be triggering the auto-sleep function. Go to Settings > Display & Brightness and adjust the Brightness slider as needed.
Turn off Do Not Disturb. If Do Not Disturb is turned on, your iPad will automatically go to sleep when you’re not using it. Go to Settings > Do Not Disturb and make sure that the Do Not Disturb switch is turned off.
Check your battery settings. If your iPad’s battery is low, it may go to sleep to conserve power. Make sure that your iPad is plugged in or that the battery level is above 20%.