First of all: If you are expecting the ugly phase to begin then you don't need to worry about it. In 99% of all cases problems will disappear on their own once the microbiology has developed a little bit.
The two options Dinoflagellates and Diatoms were already mentioned but it's usually a good Idea to give some context:
1. Diatoms are the first type of algae that visibly takes over a tank during the ugly phase. There aren't many competitors in the first few weeks/months for them and new dry sand can release quite a lot of silicate into the water which diatoms use to create their outer "shell". To prevent further silicate from entering the system you only need to make sure the RO/DI water you use is properly deionized. If you have your own RO/DI system you will need a measuring device for that, otherwise it depends on your water source/seller what you can do.
2. Dinoflagellates are feared by many when appearing in established tanks, but they are usually harmless during the ugly phase. They are associated with very low nutrient levels which are common in new tanks (whether they are the cause or symptom of low nutrient levels doesn't matter too much right now). Either way, they are capable of photosynthesis and some are known to eat diatoms. This means even in young tanks with very limited nutrients they can thrive but most likely vanish once the diatoms are gone. If they don't disappear within the first months we can talk about how to get rid of them. I wouldn't really recommend a UV sterilizer, or even chemicals right now as your tank is still developing.
You don't need to do anything for now besides ensuring the RO/DI water is properly deionized and maybe adding some copepods. This way you already have some little beneficial helpers that actually eat diatoms and dinoflagellates and will provide a great food source for your fish in the future. Turn off the water flow when adding them so they don't end up in the skimmer immediately. If you already have fish in your tank you can add them at night when the light is off so they don't get eaten right away.