Scientists believe they have found a way to dampen down the impact of bad memories in people's brains.