Before we started using synthetic dyes for everything under the sun, natural dyes were used for tens of thousands of years. While they weren't without their own environmentally dubious large-scale practices, the creation, application, and disposal of natural dyes was, on the whole, much less harmful to both humans and the environment.
While he wasn't the first to create a synthetic pigment, an 18-year-old chemist named William Henry Perkin discovered/invented the pigment mauveine in 1856 from the synthesis of aniline (initially he was attempting to synthesize a treatment for malaria). He was first, however, to capitalize on the invention, initially calling his synthetic dye Tyrian Purple after the lost, highly-valuable dye from antiquity. The French Empress of the time caught onto this invention and favored the color, leading to more widespread use in fashion items designed for the upper echelon of society.
However, due to issues with sun exposure quickly fading away colors, it wasn't until another chemist named James Morton succeeded in creating light-fast synthetic dyes before the use of artificial dyes took off. in the early 1910's, he began marketing his products to high-end fashion houses in England such as Burberry and within the next 30-40 years, synthetic dyes were well on their way to becoming the industry standard they are today.
If you take a look around the room today, you will see books, textiles, foods, makeup, and (depending on where you are) even medical devices that all utilize synthetic dyes.
While the use of synthetic dyes has made a large hue of colors readily and cheaply available to consumers all across the world, it has some very deleterious consequences to the areas in which its used, and to the people who work directly with them. The vast majority of synthetic dyes are carcinogenic and toxic to lifeforms, and incredibly hard to remediate. And in countries where they are used (especially for textile use) such as Bangladesh and India, lacking environmental and governmental regulations means that most dye houses dump their used up dyes directly into rivers and waterways, which has killed entire rivers and made drinkable water harder to come by for the villages and cities who reside on those waterways.
Sources:
https://collection.sciencemuseumgroup.org.uk/objects/co67835/silk-skirt-and-blouse-dyed-with-perkins-mauve-aniline-dye-dye-cloth
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8270347/
https://www.cnn.com/style/article/dyeing-pollution-fashion-intl-hnk-dst-sept/index.html
https://www.planetcustodian.com/dyeing-industry-polluting-asian-rivers/15641/
https://www.sciencemuseum.org.uk/objects-and-stories/chemistry/colourful-chemistry-artificial-dyes