Sadness, loneliness, lamentation and regret are all part of the same family of emotions that keep us stuck in the past. In so far as they obstruct us from happiness, the emotions themselves are not really the problem. The more pressing concern is our tendency to identify with them. As long as we allow ourselves to become the emotion instead of noting it as just another arisen phenomena, we will be at its mercy.
If we find that we have an inability to separate ourselves from our difficult emotions, we should not allow that difficulty in and of itself to become yet another reason for us to feel dejected. We should instead be inspired by the prospect of developing another and better way to experience the world. This is the Buddhist approach: we learn by acknowledging our mistakes instead of becoming obsessed with them. There is always an opportunity to overcome the past and strengthen our character.
How do we allow this new character to take shape? We need to find a way to reverse the negative spiral around regret and replace it with a cascade of positive habits. This begins first and foremost with developing the skill of mindfulness which arises by mental noting in the present moment. When we have established noting as a foundation, we can then use this skill first to watch when the mind is going astray down a dark alley, and second to neutralize this pattern by bringing the mind back into the present moment — that is, noting directs the mind to become aware of what is actually happening right now.
If, with proper training, we repeat this pattern on a regular basis, we will eventually become consumed within a positive spiral centered on emotional security. Our happiness will be based on inner peace derived by mental noting rather than external gratification and then we will finally start to feel free.