Workers visa, Student visa, etc.
The difficulty is that an overstay is general grounds for refusal under the Immigrations Rules for all applications except those based upon a relationship (eg.marriage, civil partnership, long-term co-habiting relationship to a UK/EEA national or other person with indefinite leave to remain in the UK. An application made on the basis of a relationship could not be rejected by virtue of the overstay alone.
Given the current immigration policy of the day it is highly likely that your friends application for a visa under any other category would be rejected due the overstay I'm afraid, a 'number of years' is quite long and therefore serious.
There is also a cap on workers visas applications which has been reached and no further applications are being entertained until further notice.
Unfortunately, it's going to be very difficult for your friend to return unless there were exceptional and provable circumstances which mean that they had no option but to overstay.
I'm very sorry it could not be better news. If this is useful please kindly click accept so that I may be rewarded for my time. You will be free to ask follow up questions.