I find that, if you aim to be liked, you’ll often end up making one too many compromises on your core values to be respected.
The other option is to choose to accept the fact that you might be respected and not liked. This is a hard choice to make because the prospect of universal popularity is very seductive. But, in doing so, you’ll make sure you never compromise on the things that matter and, in doing so, do work that matters to you.
Funnily enough, that generally means you will actually be liked by the people who choose to spend time with you. Sure, it is not universal popularity. But, I’d argue that it is the sort of popularity that actually matters. Our happiness is a by-product of the ten people we spend most of our time with.