The prohibition to create and continue a Machlokes/dispute:
It is forbidden to hold onto and continue [or lend support to] a dispute, and one who does so transgresses a negative command, as the verse states “Do not be like Korach and his people.” This applies even if in truth one’s side is completely correct and the other side is guilty of wrongdoing, as even Moshe who was correct, went to make peace with Dasan and Aviram, and if he were to not do so he would have transgressed a Biblical command. One should distance himself from it like one distances from fire.
The definition of a Machlokes: On a community level, Machlokes is defined as splitting a community and making different sides due to disagreement. It is also considered Machlokes to bring up controversial matters that have been negated by majority of the community and cause a ruckus due to it. On a personal level, Machlokes is defined as words and actions that create social discord between one another.
What is the prohibition of “continuing” a Machlokes: This means that one is to actively pursue options for ending the dispute and that he should take advantage of opportunities to end it, even if it means placing his pride aside, and even if he has already tried before in the past. For example, if a person who used to say hello and greet you upon seeing you, suddenly stopped doing so, you should not act likewise and avoid greeting him when you see him, and rather you should continue to act cordial and greet him in order not to hold onto a dispute.
Machlokes Lesheim Shamayim-for religious matters: The above prohibition applies even to a Machlokes that is Lesheim Shamayim, for religious reasons. A person should even nullify a custom or Chumra to avoid Machlokes. Majority of suffering and tragedies experienced by the Jewish people come as a result of Machlokes Lesheim Shamayim.
The prohibitions transgressed with Machlokes: Aside for the innate prohibition against making a Machlokes, Machlokes also leads to other prohibitions. It leads to hatred, which transgresses the command of “Do not hate your brother in your heart.” It also leads to various other Biblical transgressions, such as revenge, Lashon Hara, anger, physical fighting, jealousy, Onas Devarim, shaming in public, and other prohibition of between man and his fellow. It also possibly transgresses the command of following the majority, and Lo Sasaur, Lo Sisgodedu
The punishments: One who continues a conflict is placed in excommunication. A home that contains Machlokes, hosts the Satan in their home. Such a home will eventually become destroyed. Many good people, endeavors, and communities have been destroyed due to Machlokes.
How to end a dispute:
From a letter of the Rebbe: Whenever there are two parties in argument over a matter in this physical world, it is nearly impossible for one party to be completely correct, and the other party to be completely at fault. Every party has at least some wrongdoing that needs amending. In fact, as explained in Chassidus, it is this wrongdoing that may have triggered the wrongdoing of the other, perhaps to even a greater quantity and quality, as the verse states that just as water reflects one’s image so too the heart of man reflects another’s heart. Many good endeavors have become sabotaged due to conflict and discord that is motivated by a desire of imaginative respect, and is at times embellished within claims of fear of heaven and matters of piety [Shpitz Chabad]. Some people, after hearing the above words, rather than make an accounting of their own soul and situation, repenting for their ways and judging the other person favorably to the point he feels humbled before him, they rather demand the above from the other party. They use this to enthusiastically preach to the other party that they should do Teshuvah, and with no less enthusiasm, they judge themselves favorably, with great scrupulousness, and demand of others that they be humble before him.
How many times must one attempt to end a dispute?
The following is ruled regarding asking forgiveness for wrongdoing, and seemingly, the same can be applied towards attempting to end a dispute: If the victim refused to forgive the offender after he approached him for forgiveness, the offender must try to appease him another two times in different ways. If the victim still refuses to forgive him, the offender is no longer obligated to try to appease him. Nevertheless, he must tell ten people that he has asked for forgiveness from the person he offended, and the victim refused to be consoled.
 See Encyclopedia Talmudit Erech Machlokes Vol. 45 p. 51-65 in great length
 Regarding why the listed prohibition is specifically against “continuing” a dispute and not simply against starting it, is because this comes to teach us that one may not continue a Machlokes even if he did not start it, and also comes to teach us that one who supports a Machlokes likewise transgresses the prohibition even if he is not the one who started it. [See Divrei Malkiel 3:73; Encyclopedia Talmudit ibid footnote 7 and 57
 Divrei Malkiel 3:73; Encyclopedia Talmudit ibid footnote 57; See previous footnote
 Bamidbar [Parshas Korach] 17:5
 Rav and Reish Lakish in Sanhedrin 110a; Smag 157 [Biblical-Possibly listed as Mitzvah 157]; Rambam and Ramban Sefer Hamitzvos Shoresh 8 [Rabbinical]; Marganisa Tava on Sefer Hamitzvos Shoresh 8; M”B 156:4; See Piskeiy Teshuvos 156:13
Other scriptural sources for the prohibition: See Reish Lakish Sanhedrin 110a who learns the prohibition from the earlier verse 16:25 “Vayakem Moshe Veyeilech El Dasan Veaviram”; See also Rashi Parshas Korach 16:12 who learns this from the previous verse of “Vayishlach Moshe Likro Ledasan Veaviram.” Vetzaruch Iyun. See Yavin Shamua Korach 354
Is this prohibition Biblical or Rabbinical? Some Poskim learn this prohibition is Biblical and is counted as one of the 613 commands. [Smag 156-157; Semak 132; Chareidim L.S. 4:42; Sheilasos 131 and Gilyonei Hashas Sanhedrin ibid in explanation of his opinion; Marganisa Tava on Sefer Hamitzvos Shoresh 8; Sefer Hamagid of P”M Korach 536; Pela Yoetz Chaf 14; M”B 156:4 in name of Smag; Meishiv Davar 2:9; Divrei Malkiel ibid; Mentioned in Likkutei Sichos 18:202 footnote 3; See also Igros Kodesh 14:391 “One is to distance himself from Machlokes, which is Biblically forbidden according to all opinion”; See also Toras Menachem 5743 1:388; See Chinuch end of Mitzvah 248; Shaareiy Teshuvah of Rabbeinu Yonah 3:58; Encyclopedia Talmudit ibid footnote 14] Other Poskim rule the verse of “Lo Yiyeh Kekorach Veadaso” is not Biblically coming to teach us against continuing a Machlokes. Rather, this prohibition is merely Rabbinical, and the verse is used as an Asmachta. [Rambam and Ramban Sefer Hamitzvos Shoresh 8 and L.S. 45; See Gilyonei Hashas ibid; Encyclopedia Talmudit ibid footnote 16] Some Poskim learn the verse of “Lo Yiyeh Kekorach Veadaso” is in truth a Biblical prohibition against arguing against the Kehuna, as did Korach, and not against all Machlokes. [Ramban Sefer Hamitzvos Shoresh Shemini 5] Other Poskim learn the above verse is not a Mitzva at all and is simply stating that one who argues against the Kehuna will not be punished like Korach was punished. [Rambam Sefer Hamitzvos Shoresh 8; Kinas Sofrim ibid; Megilas Esther ibid]
 So was done by Moshe, who was certainly correct in his dispute; See Riy Milunil on Rif in Sanhedrin ibid; Pirush Marzu on Bamidbar Raba 18:20; Encyclopedia Talmudit ibid footnote 10
 See Kav Hayashar 3; Rambam ibid
 See Encyclopedia Talmudit ibid
 See Nimukeiy Yosef Megilah 24b
 See Encyclopedia Talmudit ibid p. 58
 See Brachos 6b and Iyun Yaakov there
 See Encyclopedia Talmudit p. 63
 Admur Igros Kodesh 32; Noda Beyehuda Kama Y.D. 1 “Today there is no real Machlokes Lesheim Shamayim”; Chasam Sofer Korach
 See Admur 468:11-14; See Igros Kodesh 14:391 regarding Nussach of Davening; 5:91; 16:12 and 99; 19:249 regarding wearing a Tallis as Chazan
 Igros Kodesh Admur Hazakein Letter 32
 See Encyclopedia Talmudit ibid “Issurim Nosafim” and “Aveiros Hanigraros Mimena”
 Sheilasos of Rav Acha 131; Encyclopedia Talmudit ibid footnote 29
 See Encyclopedia Talmudit ibid “Chumrasa” p. 59-61
 Kav Hayashar 34
 Zohar 1:37
 Derech Eretz Zuta 9
 Rambam in his will to his son
 Igros Kodesh 13:19; 3:20; 11:138
 Admur 606:2-3; Michaber 606:1
 Admur 606:2; Michaber and Rama 606:1