The best work is probably less popular. It’s best because it’s new, unique, challenging, creative, different.
If you always do your best, you’ll maintain your reputation. That reputation might be as someone with values which can’t be compromised.
Sometimes your best is to listen to what people want and accept your short term loss for a long term win.