How does one prevent the following Warning ‘Warning: Cannot modify header information – headers already sent’ and why does it occur in the first place?

TechnicalSenior php developerPHP DeveloperBackend Developer