If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup).
If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present.
You may have to force iPad/iPod into Recovery Mode
Don't go into recovery mode for this or do a restore. Try something simpler and faster first.
If the device has a regular passcode set you can exit guided access by resetting the phone.
Hold the power and home buttons down at the same time for about ten seconds. The phone will reset and shut off.
Then you can reboot the phone and you will be out of guided access.
If you do not have a code set on the lock screen (just a regular locking code, not a guided access code) this may not work.
Try it and see.
I *think* you will then be able to go into settings and then:
- set up a new guided access you remember
- write it down someplace safe