Mac doesn't respond after sleep mode: how to Prevent this?

I had the same issue on my mini. The first thing you might try is resetting your PRAM and then your PMU. These control sleep on your mac. If they fix it, and it goes bad again, you may need to take it in for warranty repair (if under warranty.)