If there is one thing that can be frustrating, it is when factors are at play that are out of a person's control. One lesson that is tried-and-true is controlling your attitude. When an event takes place that isn't to one's liking, a person can either be mad about it, or adjust to the situation and try to bring things back to a positive place.
At one time, being petty was celebrated. Hell, there are still times when being petty is employed, and it's never mean-spirited. It's usually either a defense mechanism or just more fun, but it rarely lasts long and it doesn't really solve anything. Realizing that is the case, being that way isn't always the best thing to do. Sometimes, the best thing to do is take a 20-second timeout, step off the court, make a quick adjustment and get back in there. If a full is needed in order to catch your breath, relax and get your bearings in a more relaxed fashion, that's cool as well.
With either approach, the goal is to get back in there and do well and not make the same mistakes as before. When done right, all's well that ends well.