Yellow Flag is used to indicate the 'Danger' sign. It universally requires drivers to slow down due to a hazard on the track, typically an accident, a stopped car, debris or light rain.
A single waved flag denotes a hazard on the racing surface itself
Two flags waved simultaneously denotes a hazard that wholly or partly blocks the racing surface. This informs the driver that there may be marshals on the track and to prepare to stop, if necessary.