Hey, thanks!
I read about it and i think i got the point. But i don’t understand how to use jquery then. Am i suppose to wirte JS files for each action?
Ideally all of your JS will be written in _main.js and then concatenated with your other scripts (Bootstrap’s and other plugins’ JS) and linted/uglified/minified into scripts.min.js so that it’s all in one place and loaded in the theme’s footer in one request.
WordPress itself doesn’t do a great job of separating JS and PHP so it’s easy to think that JS in the middle of a PHP template is ok. There may be some cases where it’s necessary but it’s a good idea to keep them separate when you can.