Once the small screw has been removed, the chrome rim comes off by twisting, if I remember correctly, anticlockwise. Going back on in the opposite direction as you align the screw hole.
The wiring is not particularly long and the headlamp is relatively heavy, so if you are able to provide a resting position for the loose headlamp at the lower level of the headlamp, you will be able to protect your paintwork from scratching and to prevent the headlamp cables from stretching and to free your hands for the work.