A positive outlook has been linked with everything from better sleep quality to fewer heart and cholesterol problems. This is how to harness it