I inserted affiliate links in almost every text.
that's a dumb idea when you're small and insignificant and when google dictates everyone what to do with their sites. I'm not calling you dumb, don't worry, only your idea is silly
How do I do it now so I don't get my ass kicked?
well, since this is most likely an algo penalty you can reverse it by removing the affiliate links from all / most of your pages.
I know that this will hurt your income (blame google because they don't want anyone else making money, but them), but try to have affiliate links on 1 out of 10-15 content pages, and even then, cloak the links using plugins like Pretty Links.
It might still be possible for google to figure out that the cloaked links are affiliate links as these companies have such technologies that we can't even dream of, so it's possible that they'll still be able to tell. But you should do it anyway since you don't have too many options....
And again - since this is most likely an algorithmic penalty - removing the affiliate links from most pages (again, try to keep affiliate links on 1 out of 10 pages at most, at least initially so you can check the results) should restore your site in the SERPs