Yellow flags localise to a sector after a crash; Full Course Yellow (FCY) covers the whole track; the Safety Car (SC) deploys for major incidents and forms up the field for a restart.
This page will document the deployment thresholds, SC pace, queue formation, restart phase, and the “free pit” window — including the AI’s recent behaviour change (it now refuses an SC pit if you’d lose track position pointlessly).
For the short version, see the Glossary entries for FCY, Safety Car, Yellow flag, and the Safety Car window section in Pit Strategy Plans.