Slathering oneself in mud if you need to endure harsh sun exposure is the most common answer I’ve seen to this question.
Otherwise, I agree with your comment, the “best practice” of avoiding sun exposure is as unintuitive as the grain-heavy food pyramid.