If you are indoors – stay there (clear of falling debris outside). Keep clear of windows and overhead fittings. Shelter under and hold onto a door frame, strong table or bench.
If outside, keep well clear of buildings, overhead structures, walls, bridges, power lines, trees, etc.
In a vehicle, stop in an open area until shaking stops. Beware of fallen power lines and road damage, including overpasses and bridges and listen to your car radio for warnings before moving.