how to prevent negative thoughts