What must we do if the vast majority of the members of the Catholic Church here on earth profess heresy and are thus excommunicate? What must faithful Christians do if the vast majority of the members of the Church here on earth, including those comprising the hierarchy or even the Pope, profess heresy (and are thus excommunicate)?



This question is seeking a Catholic answer, specifically, one from a sedevacantist perspective.
St. Vincent of Lerins, in his Commonitory lib. 1 cap. 2 n. 6-8, says to "follow universality, antiquity, consent."


  “Also in the Catholic Church itself we take great care that we hold
  that which has been believed everywhere, always, by all. For that is
  truly and properly Catholic, as the very force and meaning of the word
  shows, which comprehends everything almost universally. And we shall
  observe this rule if we follow universality, antiquity, consent. We
  shall follow universality if we confess that one Faith to be true
  which the whole Church throughout the world confesses; antiquity if we
  in no wise depart from those interpretations which it is plain that
  our ancestors and fathers proclaimed; consent if in antiquity itself
  we eagerly follow the definitions and beliefs of all, or certainly
  nearly all, priests and doctors alike.”
  
  “What, then, will the Catholic Christian do if any part of the Church
  has cut itself off from the communion of the Universal Faith? What
  surely but prefer the soundness of the whole body to a pestilent and
  corrupt member?
  
  “What if some novel contagion seeks to infect the whole Church, and
  not merely a small portion of it? Then he will take care to cling to
  antiquity, which cannot now be led astray by any novel deceit.
  
  “What if in antiquity itself error be detected on the part of two or
  three men, or perhaps of a city, or even of a province? Then he will
  look to it that he prefer the decrees of an ancient General Council,
  if such there be, to the rashness and ignorance of a few.
  
  “But what if some error spring up concerning which nothing of this
  kind is to be found? Then he must take pains to find out and compare
  the opinions of the ancients, provided, of course, that such remained
  in the communion and faith of the One Catholic Church, although they
  lived in different times and places, conspicuous and approved
  teachers; and whatever he shall find to have been held, written and
  taught, not by one or two only, but by all equally and with one
  consent, openly, frequently and persistently, that he must understand
  is to be believed by himself also without the slightest hesitation.“