Optimism is a mindset shaped by your brain’s structure and function. Here's how you can train your brain to be more optmistic.