Exercise rarely contributes to losing weight.
What contributes to losing weight is increasing your metabolism; which is done by increasing muscle mass and eliminating fat stores.
Currently, the most effective way to lose fat and gain muscle with exercise in the shortest period of time is doing very intense interval training.
But if you do it properly the exercise regimen is not for the faint of heart or people who prefer just walking/low key exercise.
It is designed to push your body to near extremes to utilize all available energy sources during the exercise and the recovery period in the following day uses fat stores (ie burns them) for energy while you limit easy energy (like carbs) for it to use.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8294064/