RAW, the DM decides each case by fiat
Unlike for damage, where there is a rules procedure for determining the order of application of multiplicative and additive effects, there is no such procedure specified for effects that modify speed and movement. Besides the lack of such rules (negative 'proof'), we have the positive statement from Jeremy Crawford. When asked:
How do speed multipliers stack with movement added before or after multipliers?
Crawford responded:
The answer depends on the text of the game features you're using. There's no general rule.
So, we need to look at the game text. In OP's specific case, we need to look at exhaustion vs. ray of frost.
Exhaustion says:
a creature suffering level 2 exhaustion has its speed halved
While ray of frost says:
On a hit...its speed is reduced by 10 feet until the start of your next turn.
Note that, despite Crawford's tweet, neither of these effects state an order of application. Thus, there is no RAW for how to apply them. Either order is valid, and RAW the DM would need to decide.
The DM could decide to apply the effects in the order they were incurred, as suggested by Anagkai (or by BlueMoon93 in their answer to this question about multiple start of turn triggers). There is a certain amount of narrative sense to that. For a character whose unmodified speed was 30, for example, 'they were already exhausted from a forced march (speed 15), and then they were hit by a ray of frost (final speed 5) would be different from 'they were already under the effects of a ray of frost (speed 20), and then they were hit with a sickening radiance (final speed 10). However, we need to be clear that this is a ruling, not a rule. Furthermore, it is a ruling that has no counterpart in other discussions about resolving simultaneous effects. There is no particular reason to apply these effects in temporal order unless the DM decides to, and this approach is not recommended or used with simultaneous effects outside of those that affect movement (in the aforementioned question about multiple start of turn triggers, for example, our venerable NautArch suggests resolving them in initiative order).
XGtE has an optional rule
The optional rule for resolving simultaneous effects is expressed in XGtE:
If two or more things happen at the same time on a character or monster's turn, the person at the game table - whether player or DM - who controls that creature decides the order in which those things happen.
Personally, I generally favor this optionally rule. As I have written elsewhere, I like that it adds more agency to the turns of individual players. I like that when it is my PC's turn, they can be in control of applying the order of the movement penalties, squeezing slightly more movement out when they want to go somewhere, or having just a bit more power to resist the forced movement caused by something like command. However, if they are moving on the turn of another, they have less control, so that the person casting dissonant whispers on them, for example, gets to decide how to apply the movement penalties.