Is it better to do cardio before or after strength training?
Or would it be best to do cardio during rest days?

This depends on your fitness goals. If your goal is to lose weight, then I would suggest putting cardiovascular exercise before strength training.
Energy is needed to perform all forms of exercise at an optimal level. Performing heaving strength training prior to cardio may have an effect on the quality of effort during your cardio session. The same works the other way around.
If cardio depletes your energy then you will not be able to give anywhere near your maximum effort to perform your strength training session. Therefore, prioritizing your goal is important while planning your program.
If your goal is to put on muscle, then adding in cardio after your strength training session would be ideal. This way your energy levels will be at it’s highest during your program's focal point.
Rest days should be used to recuperate. Active rest days should not be very strenuous. With that said, scheduled cardio sessions may not be best practice.
Energy plays a key role in whether or not you’ll follow through with cardio so maybe adding in small intervals of cardio between strength training exercises may be great for you. In fact, you can put together a great plan like that yourself with our workout builder.