How do I add css/js to `<head>` from partial content/template

I would like to mention my solution to the problem from another more unpopular but more current forum discussion! How to associate CSS to a specific partial and render it in section of the HTML