A new study has revealed that keeping control of your emotions could be the key to preventing dementia.