Scientists discover how the brain learns to overcome fear