How could I remove third-party scripts from the frontend?

How could I remove third-party scripts from the frontend?

In best case I could store the scripts local and download all github images once.