Why do I get security warning & how to remove?
So as he why you get security warnings: because civi has found your configuration insecure, ie. you have files that shouldn't be accessible on the web but are.

As how you fix it (and get rid of the warnings), it depends on the web server you use and how it's configured.

The .htaccess rules only work for apache, and only if it's configured to read them. If you use nginx or another webserver, you will need to implement the rules denying access to these forbidden folders differently.