There are two ways to become more resilient: one by talking to yourself, the other by retraining your brain.