thats the way the cookie crumbles

Thats the way the cookie crumbles is a phrase which means that occasionally bad things are going to happen to you in a way that you could not have known beforehand and nothing you could have done would have prevented it. In this way, you should simply accept it rather than be upset over it or wish you had done more to prevent it from happening. The phrase was made popular again after the movie Bruce Almighty came out.