After he/she wakes up from sleeping, set them outside.
Allow them to go to the bathroom.
Give them the treat if they succeeded.
"Praise" them so they know it's a good thing.
It may not really work the first few times, but eventually they'll get used to it.