Unless someone has evidence contrary to the Second Law of Thermodynamics, there is only one way to lose weight: energy ingested must be less than energy burned (aka calories in vs calories out).
How you do that is up to you. Some useful advice given already (e.g., using a calorie tracker) but also much unscientific disinformation and myths that belong to the 1960s.
If you can only ride 3 times a week, don’t waste your time in z2: sweet spot (90% of FTP), threshold (95-105%), and VO2max (110%+) rides and workouts get the most bang for your buck, while varying your training to get you stronger and fitter at the same time. If you can ride every day, then by all means ride most of them at z2-3 (70-85%).
For the record, I lost 10kgs in 8 weeks purely by burning 800-1000 calories on zwift and eating whatever I liked, so long as it was around 2400-2700 calories for the day. With my metabolic rate at around 1850 calories, plus daily activities like walking our dogs, that was enough to ensure a calorie deficit.