Suppose something bad happens to person X, who you care about. The bad thing wasn't anything you had control over, so you have no reason to feel bad about it. But now you have a chance to help X. Whether you help them or not is something you do have control over, so if you do help them, you should feel good about it.
But suppose that you fail to help them. Now it may or may not be appropriate to feel bad, depending on why you fail to help them. For instance, maybe you are driving to their home, but on the way there your car breaks down. Presuming you hadn't ignored clear signs of an immediate breakdown or otherwise clearly neglected the maintenance of your car, then it breaking down wasn't really under your control. This prevents you from helping them, but it still isn't something that you should feel bad about. Feeling bad is a feedback mechanism to teach you lessons about what you did wrong, and there are no useful lessons to be learned here.
You should only feel bad if you failed because of something that was under your control. Maybe you were going to take a bus to them, but got stuck online and missed the last bus. Or maybe you drove your car carelessly and got in an accident. In that case it's okay to feel bad, as your behavior mechanisms need feedback.
This reminds me of a video game that I used to play. In Creatures 2, the player takes care of several artificial animal-ish creatures called norns. Interestingly, norns actually learn - they have a simulated brain with simulated reward and punishment chemicals, and whatever 'neurons' are firing when there are 'reward chemicals' fire more often in the future and whatever 'neurons' are firing when there are 'punishment chemicals' fire less often in the future, causing them to show more of certain behaviors and less of others.
Unfortunately, the game was released without adequate playtesting, and the default norns' learning systems turned out not to be calibrated properly. Individual norns seemed to learn fine at first, but eventually turned stupid as they aged, jumping off of cliffs and refusing to eat. With some work, the player community figured out what was wrong: The default norns' punishment and reward chemicals had too long of a half-life, and tended to stay in the norns' systems long enough to affect several brain-states. Fortunately, once this was discovered, it was easy for some of the more advanced players to design norns without the issue (yes, the game allowed for genetic engineering!) and release them to the public, and the new norns learned just fine.
Follow-up to: Suffering as attention-allocational conflict.
In many cases, it may be possible to end an attention-allocational conflict by looking at the content of the conflict and resolving it. However, there are also many cases where this simply won't work. If you're afraid of public speaking, say, the "I don't want to do this" signal is going to keep repeating itself regardless of how you try to resolve the conflict. Instead, you have to treat the conflict in a non-content-focused way.
In a nutshell, this is just the map-territory distinction as applied to emotions. Your emotions have evolved as a feedback and attention control mechanism: their purpose is to modify your behavior. If you're afraid of a dog, this is a fact about you, not about the dog. Nothing in the world is inherently scary, bad or good. Furthermore, emotions aren't inherently good or bad either, unless we choose to treat them as such.
We all know this, right? But we don't consistently apply it to our thinking of emotions. In particular, this has two major implications:
1. You are not the world: It's always alright to feel good. Whether you're feeling good or bad won't change the state of the world: the world is only changed by the actual actions you take. You're never obligated to feel bad, or guilty, or ashamed. In particular, since you can only influence the world through your actions, you will accomplish more and be happier if your emotions are tied to your actions, not states of the world.
2. Emotional acceptance: At the same time, "negative" emotions are not something to suppress or flinch away from. They're a feedback mechanism which imprints lessons directly into your automatic behavior (your elephant). With your subconsciousness having been trained to act better in the future, your conscious mind is free to concentrate on other things. If the feedback system is broken and teaching you bad lessons, then you should act to correct it. But if the pain is about some real mistake or real loss you suffered, then you should welcome it.
Internalizing these lessons can have some very powerful effects. I've been making very good progress on consistently feeling better after starting to train myself to think like this. But some LW posters are even farther along; witness Will Ryan:
Some other LW posters who've made considerable progress on this are Jasen Murray, Frank Adamek and Michael Vassar. I invite them to post their experiences in this thread, and in future posts of their own.
How does one actually achieve emotional acceptance? It is a way of thought that has to be learned with practice. There are various techniques which help in this: I will cover one in this post, and others in future ones.
Mindfulness practice
Mindfulness techniques are very useful in realizing that your thoughts and emotions are just things constructed by your mind:
It also has clear promise in reducing suffering:
I recommend the linked paper for a good survey about various therapies utilizing mindfulness, their effects and theoretical explanations for how they work.
While I haven't personally looked at any of the referenced therapies, I've found great benefit from the simple practice of turning my attention to any source of physical or emotional discomfort and simply nonjudgementally observing it. Frequently, this changes the pain from something that feels negative to something that feels neutral. My hypothesis is that this eliminates an attention-allocational conflict. The pain acts as a signal to concentrate on and pay attention to this source of discomfort, and once I do so, the signal has accomplished its purpose.
However, often I can do even better than just making the sensation neutral. If I make a conscious decision to experience this now-neutral sensation as something actively positive, that often works. Obviously, there are limits to the degree to which I can do this - the stronger the discomfort, the harder it is to just passively observe it and experience it as neutral. So far my accomplishments have been relatively mild, such as carrying several heavy bags and changing it from something uncomfortable to something enjoyable. But I keep becoming better at it with practice.