Caution
A tiny, silent flash as the pins touch a switched-on socket is current starting to flow and leaves no mark. A large, loud or orange spark, a spark every time, scorch marks, or a trip is a fault: stop using that socket and get it checked.
High risk
A plug socket is sparking, arcing, or producing flashes of light during normal use.
A light switch that sparks when you flick it usually has worn contacts or a loose wire behind the faceplate. Stop using it, switch the lighting circuit off at the consumer unit, and have an electrician replace the switch. If the plate is scorched, hot or smells of burning, treat it as urgent.
Emergency
Your fuse box (consumer unit) is sparking: flashes, arcing, or crackling from the board in the hall cupboard or under the stairs. In UK homes that is an extreme electrical emergency: the unit carries the full mains load, and arcing inside it can start a fire. Do not open the cover or touch sparking parts. If the main switch is safely reachable and the unit is not on fire, turn it off. If there is smoke, flames, or any doubt, evacuate and call 999. Then book an emergency electrician. The Distribution Network Operator (DNO) may need to pull the main fuse before work can start.
An electrical arcing or crackling sound is electricity jumping a gap - usually a loose connection, worn switch contacts, or damaged insulation - and it is a fire risk until that gap is found and fixed.
You see a spark or flash at the socket when you turn the switch on with a plug inserted.
Describe the job and get a fixed price from a local electrician.