The iPhone’s Night Mode can be set to maximum duration to improve the quality of night photos, as this allows the phone’s camera to gather more data.
You can also adjust the exposure manually by tapping the part of the scene you want to focus on and then reducing the exposure to improve the contrast of the image.
Enabling the ProRAW format on iPhones 12 Pro and above allows for more control over exposure, colour and noise reduction.
Turning off the setting which prioritise faster shooting can also improve picture quality, though you will have to tolerate a slight delay before the photo is taken.