In an MVC structure, the controller provides the link between the model and the view. It is responsible for deciding what data should be passed through to the view. The controller is where you should do all of your data processing before loading the page.
You should also use the controller to register and enqueue scripts and styles, rather than linking to them in the header. This allows you to prioritise files and ensure that they are loaded in the correct order.