I think one should be a combination of both. It’s important to be optimistic, see things positively and approach them optimistically, if you don’t do so, it becomes challenging to get what you want.
On the other hand, one should also be aware of the reality and be able to see and accept things as they are. In some situation, you have to accept things as they are and be optimistic for a better future. That’s how one can lead a happy life.