(Distress, Urgency, Safety and Warning Signals)
There are two grades of emergency. Distress = grave and imminent danger requiring immediate assistance, call "MAYDAY MAYDAY MAYDAY". Urgency = a difficulty (e.g. compelled to land) but no need for immediate assistance: call "PAN-PAN PAN-PAN PAN-PAN". Use the frequency already in use, or the emergency frequency 121.5 MHz. Set the transponder to 7700 (distress), or 7600/7500 as appropriate.
Worked example, constructing a MAYDAY. Engine failure, forced landing imminent. The call, in order: "MAYDAY MAYDAY MAYDAY, [station addressed], G-ABCD, engine failure, forced landing, 5 miles north of Oxford, 2,000 feet descending, heading 270, two persons on board, student pilot." The skeleton is: who you're calling, who you are, the nature of the emergency, your intentions, position, altitude and heading, and persons on board.
For visual/sound distress signalling: SOS in Morse, a succession of single red pyrotechnics, or a red parachute flare. A ground warning to an aircraft straying into a prohibited/restricted/danger area is a series of projectiles giving red and green stars/lights at 10-second intervals: leave the area, normally without descending.