I have several 404 not found pages which I would like to noindex through .htaccess.
how do I do it with
In your case, instead of preventing indexing for your 404 pages, you should consider to create a specific 404 page by adding this line in your .htaccess file:
All your current 404 pages would be redirected to your specific 404 page and would be removed from search engines' index.
If your current 404 pages are old pages, you can return a 410 HTTP status (Gone) with these lines in your .htaccess file:
Theoretically, it helps search engines to remove pages quicker from their index.