Optimal control techniques are known to enable steering the dynamics of few-systems in order to prepare a desired state or perform a desired unitary transformation. I will present a recently developed optimal control method that allows doing so for a many-body quantum system undergoing e.g. a quantum phase transition in the non-adiabatic regime. I will present detailed calculations we performed for different experimental scenarios together with the corresponding results obtained by experimental groups in different fields from cold atoms to spin squeezing in atomic ensembles and diamond NV centres. I will conclude by showing some recent results we obtained in this context as well as further questions opened by our investigations.