You can build self esteem by having a life that you enjoy without your partner. Then your happiness is tied to what you do, and not who your with.
You have to be happy with yourself, so you can share that with others. Another way to build self esteem, is to be your own person, and love yourself for who you are. Being proud of the things you do, and what you stand for.