This is a great axiom to remember, and a form of it even appears in the book of Proverbs in the Old Testament of The Bible. The verse reads: "A cheerful heart is good medicine, but a crushed spirit dries up the bones," Proverbs 15:22 (NIV). And other verses say similar things. So this concept has been around a long, long time.
People who have successfully battled cancer will often say a positive outlook and laughing at their situations has helped as much as any medical treatment they received. Even those with terminal cases often live much longer than doctors predicted because of a positive, cheerful outlook.
A saying that's over 2,000 years old *must* have a little truth behind it.