“Mixing between males and females in education is unlawful and an abominable act because it leads to temptation and corruption and is likely to lead to prohibited matters. Its evil consequences such as temptation and corruption is hard evidence that it should be prohibited.There a significant difference between mixing in education and mixing during Tawaf. During the lifetime of the Prophet (peace be upon him), women used to perform Tawaf behind men…. ”

The Permanent Committee for Scholarly Research and Ifta’

Source

Shaykh Ibn ‘Uthaymeen:

Question:
Muslim women and their daughters in western countries where there are Muslim minorities face very difficult circumstances in that education and work are mixed environments. We are caught between two possibilities. Either we cut-off our provision, stay at home and beg and as a result sink to a very desperate material condition, or, alternatively, wear our Islaamic hijaab and study and work in those societies which do not differentiate between mixing and separation. What is your esteemed opinion concerning this matter?

Answer:
Concerning this very crucial issue, I believe that it is obligatory for a Muslim to patiently adhere to and persevere with Allaah’s religion and not to be of those whom Allaah describes, saying: {And of mankind are those that say, “We believe in Allaah.” But if they are made to suffer for the Sake of Allaah, they consider the persecution of mankind as Allaah’s punishment…}, [Soorah al-‘Ankaboot, Aayah 10].
A Muslim must be patient and if it is not possible to gain a livelihood except by what Allaah has forbidden, namely through the mixing of men and women, then this livelihood must be abandoned and another sought from another direction or from another country. Was Allaah’s land not vast enough for you to emigrate therein? This is also true with respect to seeking knowledge. How good it would be if the Muslim minorities could establish their own schools based on the religion of Islaam, where boys and girls are taught separately. If that could be achieved it would be a great blessing. It is not possible, however, for us to permit the mixing of the sexes because of the seriousness of the issue and the level of temptation contained therein.

[Shaykh Ibn ‘Uthaymeen al-Aqalliyaat al-Muslimah – Page 74, Fatwa No.14]

Taken from here

I will suggest to do online schooling or private tutoring or night schooling of which there isn’t really free mixing in it or to study abroad or something of that sort and Allah knows best.

~ Abu Fajr AbdulFattaah bin Uthman