Due to population growth and economic development, there has been an increase in global wastewater (WW) generation footprint. There are different technologies associated with the wastewater treatment (WWT) process. The challenge is to select technologies that minimize the cost of treatment, as well as meet purity requirements. Further, there is a need to integrate sustainability analysis to facilitate a holistic decision. With the application of systems engineering, sustainable and cost-effective solutions can be achieved. In this work, we apply systems engineering to generate a sustainable and cost-effective solution. A superstructure was generated by categorizing technologies into four treatment stages. After modeling all functional equations for each technology, an optimization problem was formulated to determine the best path for the treatment process. Mixed-integer non-linear programming (MINLP), which implements a 0–1 binary integer constraint for active/inactive technologies at each stage was used. Sustainability analysis was performed for each representative case study (municipal and pharmaceutical WWT) using the sustainable process index (SPI). The total cost of municipal WWT is 1.92 USD/m3, while that for the pharmaceutical WWT is 3.44 USD/m3. With the treatment of WW, there is a reduction of over 90% ecological burden based on the SPI metric.