Welcome.
To fix your headlamp condensation issue you need to first dry them out after removing the rear covers on a warm dry day, maybe with careful use of a hairdryer, and then replace the rear covers with new parts for your BMW dealer that include new seals.
To cure the cloudiness you can buy DIY restoration kits to polish the lenses but this may only give a short term improvement and it will need doing again regularly unless a good UV protecting sealant is supplied with the kit. A better solution is to get your local paint shop to finely sand and then lacquer the lenses, as I’ve done on my coupe.
Aftermarket headlamps are also available but quality is questionable and they can look a bit cheap.
Chris