Addressing four persistent problems, namely human-induced environmental change, financial instability, inequality and unemployment has now become an urgent necessity. To better grasp complex interactions between technological, financial and energy systems, we propose a formal behavioral-evolutionary macroeconomic model. It describes the coevolution of four populations, namely of heterogeneous consumers, producers, power plants and banks, interacting through interconnected networks. We examine how decisions by all these economic agents affect financial stability, the direction of technological change and energy use. The approach generates non-trivial, even surprising insights, such as that brand loyalty, captured by a network externality on the demand side, can increase the likelihood of bankruptcies of banks. Cascades of such bankruptcies are found to be more likely under greater income inequalities and higher electricity prices. We employ the model to assess macroeconomic impacts of sustainability policies along three dimensions: environmental effectiveness, financial stability and socio-economic consequences.