Training yourself to be more optimistic can be as difficult as training for an athletic event. You have to do the work repeatedly and consistently to see an effect. Expressing gratitude can help. Spending time outdoors, in nature, can help but only if you take time to notice the incredible beauty of ordinary events. Pay attention to how people treat others: some will ignore people and move on without acknowledging them. But other take the time to engage, and listen, and offer encouragement (something we all need). This helps build optimism because often by helping others, we help ourselves.