Whatever you feel is best for you. If you want to lose weight (I'm assuming that's the issue), prioritize cardio and make sure you are eating right (not crash dieting). Try and focus on being active and walking as much as possible (10k steps on a flat terrain is pretty reasonable to do and equates to ~300 calories, which should be most of one of your daily meals burned off). If you can cylce or run, fantastic! If you can't that's ok. Walking a reasonable distance per day is underrated.
Weights burn calories too but not at as high of a rate. My steps per day burn more than when I do resistance training for an hour (and I work an office job). If you lift weights you will build muscle, but it will be covered by fat, so focus on losing excess weight first and building muscle can be a later phase.
Cardio will also help with your heart health and circulation which will help you last longer in the bedroom and help with bloodflow to your dick.
Last bit of advise: Being in a calorie deficit (losing weight) will naturally reduce your sex-drive. So if you're still having issues, it will be for that reason. Remember that and don't give up. If done right, you will be surprised how fast you can lose weight. To counter this issue, I would again recommend the viagra but its your body and you do what you feel is best for you. Just saying there's nothing wrong with it and its totally safe. The worst symptom you'll get is a headache.