How to proceed when advisor asks you to resign?
This is a difficult situation. Regardless of the facts of the matter, there appears to be have been a breakdown of trust/communication: either the advisor has been sending signals for a while that the person didn't pick up on, or the advisor is indeed pulling this out of the blue, which also signifies a breakdown of communication. 

Probably the best first thing to do is for the student to set up a meeting with the advisor to understand the advisor's reasons. It's possible that a face-to-face meeting might allow the advisor to express their underlying concerns in a more productive way that could lead to a concrete plan for activities. 

If that fails, or the advisor refuses to meet, the next person to involve is usually the chair of graduate studies at the department (or the equivalent). There is usually someone whose job is to oversee the graduate program and manage conflicts like this. They might be able to mediate a rapproachment between the advisor and student (or even find another advisor for the student). I've had to do this in the past when I served in this capacity. 

Bottom line: if the facts are as you outlined, then I think the student deserves a more reasonable explanation from the advisor as to why they're being terminated. Sadly though, in my experience  I've often found that students ignore signals being sent to them, and that advisors are unwilling/unable to give direct and clear feedback.