It appears your question of low self-esteem has two parts. One when it relates to one's relationship with others and one when it relates to yourself.
OP: It immediately comes to my mind that it is related to things feeling
dualities like inferiority-superiority, hatred-love, aversion-craving,
and somehow it is also related to confidence.
This is when self-esteem relates to one's relationship with others. For this, the Buddhist technique to use is the Brahmaviharas.
The four brahmaviharas (sublime states of mind) are compassion (karuna), empathetic joy (mudita), loving kindness (metta) and equanimity (upekkha).
Compassion is directed at others who are suffering much worse than we are. We would want to help alleviate their suffering. It overcomes the feeling of contempt.
Empathetic joy is directed at others who are doing much better in life than we are. We would want to feel joy when others experience good fortune in their lives. It overcomes the feeling of envy and jealousy.
Loving kindness is directed at everyone (including ourselves) and includes everyone who are suffering no less and no more than we are. This covers the case of equals. We would want them all to experience happiness and contentment in their lives. This overcomes the feeling of hatred and ill will.
The above is how we relate and react to others. The next Brahmavihara relates to how we respond when others react to us.
Equanimity is how we respond when others react towards us in good or bad ways. We should not feel elated when praised or dismayed when chided. It overcomes passion and aversion.
The next one is the Buddhist technique to use when it comes to low self-esteem as it relates to yourself, by yourself.
Self-esteem is eroded by remorse. Remorse can be overcome by consistent practice of virtues in thought, word and deed. The minimum practice of virtues are the five precepts.
It's not good,
the doing of the deed
that, once it's done,
you regret,
whose result you reap crying,
your face in tears.
It's good,
the doing of the deed
that, once it's done,
you don't regret,
whose result you reap gratified,
happy at heart.
Dhp 67-68