When you are stuck in Guided Access mode, you are really stuck as the typical triple tap on the home button to quit out of Guided Access doesn't work. Even a forced exit won't work because the power button and the home button are disabled.
The only way to get out of Guided Access is to press the Home and Power button together for 15 seconds. This should turn off Guided Access by forcibly rebooting your device. Once your device is restarted, you can then go to Settings > Accessibility > Guided Access > Guided Access - and turn off Guided Access if needed.
Use Guided Access on iPad - Apple Support
Use Guided Access with iPhone, iPad, and iPod touch - Apple Support