Hi Debbier12,
The problem that you described sounds like a kernel panic, which is discussed in this Apple support article. That article will cover most of the information you will need to resolve your issue. One kernel panic isn't a big deal, but if you have recurring kernel panics, you might want to take it into the Apple Store for service. You can try to troubleshoot an issue like that yourself, but I wouldn't recommend it. Regardless of whether or not a kernel panic re-occurs, make sure that you have the latest software updates installed on your computer to help prevent future issues and to ensure the overall 'health' of your MacBook Pro. Oh, and by the way, putting your computer to sleep was not the problem. 😉
Let me know if this post answered your question!
Warm wishes,
zfJames