I'd say for the helmet, find a foam pattern that's close, and modify it until you get the right shape. It'll probably take a few attempts before you get it right. These two look like they have similar shapes:
https://www.etsy.com/listing/1010461777/space-pilot-helmet-foam-pattern
https://www.etsy.com/listing/933369412/diy-simple-basic-superhero-eva-foam
For the visor, a lot of the Mandalorian cosplayers use a welding visor, cut and heat-shaped to fit. They are very stiff though, so if you don't heat-shape it to exactly the right shape, it'll bend the foam helmet out of shape. I used one of these for my Shovel Knight helmet (pic in my profile), but that helmet is covered in Worbla, so it has the strength to resist being stretched by the visor. This is that welding visor:
Hobart 770580 Face Shield Replacement Lens, Shaded https://www.amazon.com/gp/product/B002VECKRO/
But maybe you could use a motorcycle or football visor, since they're already in the right shape. I searched "tinted visor" on Amazon and found this one. Looks like you could just cut this one to the right shape?
https://www.amazon.com/ILM-Motorcycle-Release-Approved-Motocross/dp/B07ZGHX75Z/