Swapping a like-for-like light switch is a beginner-legal job in many places when done by the book. The book is short: kill the circuit, prove it dead, copy the wiring exactly.
Riley Brand
A straight swap - old single switch out, same-type new switch in - is within reach of a careful beginner where local rules allow it (check yours; some jurisdictions require licensed electricians for any fixed wiring, and rental properties usually do). What is NOT a beginner job: anything involving the consumer unit/panel, aluminum wiring, scorched or melted wires, two-way/three-way circuits you do not fully understand, or any wiring that does not match what this guide describes.
The honest test: if removing the faceplate reveals more wires than you expected, colors you cannot identify, or anything burnt - photograph it, put the plate back, and call an electrician. There is no shame in it; there is considerable shame in the alternative outcomes.
Turn off the correct breaker at the panel - and then behave as if you got it wrong. Flip the switch and confirm the light is dead, then test at the switch itself: a non-contact voltage tester ($15, beeps near live wire) held against each wire before touching anything, every time, even after a successful first check. Testing-before-touching is the whole religion of electrical DIY.
Tape over the breaker or put a note on the panel so nobody helpfully restores power mid-job, and work in daylight or with a torch - not by the light of the circuit you are about to disconnect. Verify your tester works on a known-live outlet first; a dead tester reads everything as safe.
Unscrew the faceplate and the switch's mounting screws, and ease the switch forward out of the box. Before disconnecting a single wire: photograph everything from two angles, and tag each wire with masking tape labeled with the terminal it came from (COM, L1, line, load - whatever your switch uses). The job is now 'copy the photo', not 'understand electrical theory'.
Loosen the terminal screws and free the wires one at a time. Note the condition: copper should be bright, insulation intact right up to the terminal. Snip and re-strip a wire tip only if it is nicked or scorched (strip about 12-15mm of insulation). If the box wobbles, the cables are crumbling, or anything is heat-discolored - stop, restore nothing, call the electrician.
Match the new switch's terminals to your photo and tags, insert each conductor fully so no bare copper shows outside the terminal, and tighten firmly - then tug-test each wire; loose terminals are the number one cause of switch failures and heat. If the old switch had an earth/ground wire to the box or plate, the new one connects the same way.
Fold the wires accordion-style back into the box without sharp kinks, seat the switch, and drive the mounting screws snug - overtightening cracks faceplates and skews the switch. Faceplate on, breaker on, and test: light on, light off, no buzz, no warmth at the plate after a few minutes. Warm plates or crackling sounds mean breaker off and a professional in.
While you are there, like-for-like includes style upgrades: a quiet rocker for a loud toggle, a metal plate for cracked plastic. Dimmers add one real requirement - compatibility with your bulbs. LED bulbs need a 'trailing-edge' or LED-rated dimmer and dimmable bulbs; mismatches flicker, buzz, and shorten bulb life. Check the dimmer's minimum load, too - a single 6W LED is below some dimmers' floor.
Smart switches usually demand a neutral wire at the switch box, which many older lighting circuits simply do not have - that discovery is the most common mid-job surprise. Confirm a neutral exists (your earlier photo answers it) before buying, or choose a no-neutral smart switch or smart bulbs instead. Anything beyond the box's existing wiring - adding a neutral, new circuits - is licensed-electrician territory everywhere.
It beeps or lights near a conductor that is energized - your proof a wire is live before touching. Test it on a known-live source first, test every wire in the box, and re-test after any interruption. At $15 it is the one non-negotiable tool for this job.
Stop - you likely have a two-way (three-way) circuit, a loop-in arrangement, or something non-standard. Put it back as photographed, restore the plate, and have an electrician do the swap. Guessing terminal assignments on multi-way circuits is how lights end up half-working and boxes end up live when 'off'.
On a simple swap, the switch went in upside down or the two conductors swapped terminals - annoying, not dangerous, on a single one-way switch. Kill the breaker, prove dead, and flip the switch body or swap back per your photo.
It depends where you live: many places allow like-for-like accessory swaps by homeowners, while others require licensed work for anything fixed. Rentals almost always require the landlord's electrician. Check your local rules first - the fine and the invalidated insurance cost more than the call-out.