dnd 5e – Slow halves your movement, Ray of frost gives -10 ft. movement Which one gets applied first?

Is there a rule about which of the effects is applied first?

If you start with Slow its

30 ft base movement halved (from Slow) = 15 ft. – 10 ft. (from Ray of Frost) = 5 ft. movement left

If your start with Ray of Frost its

30 ft base movement – 10 ft. (from Ray of Frost) = 20 ft, then halved (from Slow) = 10 ft. movement left

Which is correct here and where do I find the rules for that?

Thanks for your time.