Highway Code Rule 115
You should also
use dipped headlights, or dim-dip if fitted, at night in built-up areas and in dull daytime weather, to ensure that you can be seen
keep your headlights dipped when overtaking until you are level with the other vehicle and then change to main beam if necessary, unless this would dazzle oncoming road users
slow down, and if necessary stop, if you are dazzled by oncoming headlights.
Test yourself on the Highway Code with practice questions.
Start practising