ISO 9001:2015 10.2: Nonconformity and corrective action
Whenever a nonconformity arises, complaints included, the organization responds to it: as applicable it acts to control and correct it and deals with what follows from it. It then judges whether action is needed to remove the causes, so the nonconformity does not happen again or somewhere else, by reviewing and analysing it, finding its causes, and finding out whether similar nonconformities exist or could arise. It carries out any action needed, reviews whether corrective action worked, updates the risks and opportunities identified during planning where necessary, and changes the QMS where necessary. Corrective action must suit the effects of the nonconformity in question. Documented information is retained on what the nonconformities were, what was done, and what corrective action achieved.
This control maps to 41 controls across 26 other frameworks. If you already hold one of them, the evidence you collected for it is the starting point here rather than new work.