When computers first came on the scene, there was an old saying, garbage in, garbage out.
Our attitudes and mind sent are a lot like those computers. The more negative thoughts, images, reading material, music, and other influences including associations with negative people we have; the harder it is too maintain a positive attitude.
Conversely, the more positive associations, images, reading material, music and general input we get, the easier it is to be positive in our attitudes and actions.
In summary, the more positive influences you have in your daily life, the easier it is to maintain a positive outlook, and to work toward a positive outcome!