For general health and fitness purposes, the order does not matter. (1)(2)(3) This meta-analysis of 10 studies found that muscle gain was not impaired when aerobic cardio was done before resistance training.
However, the modality you choose to do first will leave you fatigued – and thus impair performance – while doing the second. For this reason, it’s recommended you do the activity you want to excel and improve the most at first, and save the other for afterwards. Be aware that this fatigue will need to be compensated for in your programming and approach to the second activity. If you have no training preference and/or enjoy both equally, it’s generally recommended to do your lifting first as lifting weights in a fatigued state could increase your chance of poor form and injury.