Stir often, not allowing it to boil. If you turn the heat up to high it may curdle so don’t turn the heat up to try and rush things. After your milk has been reduced by half you can begin to stir in 1/4 cup sugar and stir until fully resolved.
Adding this later rather than at the beginning prevents it from caramelizing while you are cooking down your condensed milk. Chill until room temperature then use like you would store-bought in your recipes.