In the US, Digital Millennium Copyright Act (DMCA) of 1998, Section 512
In the EU, E-Commerce Directive (2000/31/EC), Copyright in the Digital Single Market Directive (2019/790/EU, “DSM Directive”), Digital Services Act (DSA).
Additionally specific countries each have their own laws on the matter.