This has been answered;
"Monks, these six are conditions that are conducive to amiability, that engender feelings of endearment, engender feelings of respect, leading to a sense of fellowship, a lack of disputes, harmony, & a state of unity. Which six?
"There is the case where a monk is set on bodily acts of good will with regard to his fellows in the holy life, to their faces & behind their backs. This is a condition[...]
"Furthermore, the monk is set on verbal acts of good will with regard to his fellows in the holy life, to their faces & behind their backs. This is a condition[...]
"Furthermore, the monk is set on mental acts of good will with regard to his fellows in the holy life, to their faces & behind their backs. This is a condition [...]
"Furthermore, whatever righteous gains the monk may obtain in a righteous way — even if only the alms in his bowl — he does not consume them alone. He consumes them after sharing them in common with his virtuous fellows in the holy life. This is a condition [...]
"Furthermore — with reference to the virtues that are untorn, unbroken, unspotted, unsplattered, liberating, praised by the wise, untarnished, leading to concentration — the monk dwells with his virtue in tune with that of his fellows in the holy life, to their faces & behind their backs. This is a condition [...]
"Furthermore — with reference to views that are noble, leading outward, that lead those who act in accordance with them to the right ending of suffering & stress — the monk dwells with his views in tune with those of his fellows in the holy life, to their faces & behind their backs. This is a condition [...]
"These are the six conditions that are conducive to amiability, that engender feelings of endearment, engender feelings of respect, leading to a sense of fellowship, a lack of disputes, harmony, & a state of unity."https://www.accesstoinsight.org/tipitaka/an/an06/an06.012.than.html
There is also this excerpt which i like;
“I hope, Anuruddha, that you are all living in concord, with mutual appreciation, without disputing, blending like milk and water, viewing each other with kindly eyes.”
“Surely, venerable sir, we are living in concord, with mutual appreciation, without disputing, blending like milk and water, viewing each other with kindly eyes.”
“But, Anuruddha, how do you live thus?”
- “Venerable sir, as to that, I think thus: ‘It is a gain for me, it is a great gain for me that I am living with such companions in the holy life.’ I maintain bodily acts of loving-kindness towards these venerable ones both openly and privately; I maintain verbal acts of loving-kindness towards them both openly and privately; I maintain mental acts of loving-kindness towards them both openly and privately. I consider: ‘Why should I not set aside what I wish to do and do what these venerable ones wish to do?’ Then I set aside what I wish to do and do what these venerable ones wish to do. We are different in body, venerable sir, but one in mind.”
The venerable Nandiya and the venerable Kimbila each spoke likewise, adding: “That is how, venerable sir, we are living in concord, with mutual appreciation, without disputing, blending like milk and water, viewing each other with kindly eyes.”http://www.yellowrobe.com/component/content/article/120-majjhima-nikaya/302-upakkilesa-sutta-imperfections.html
Whenever someone was behaving particularly bad this was advised;
The practice of Dhamma, [1] the practice of continence, [2] mastery of this is said to be best if a person has gone forth from home to the homeless life. But if he is garrulous and, like a brute, delights in hurting others, his life is evil and his impurity increases.
"A quarrelsome bhikkhu shrouded by delusion, does not comprehend the Dhamma taught by the Awakened One when it is revealed.
Annoying those practiced in meditation, being led by ignorance, he is not aware that his defiled path leads to Niraya-hell. Falling headlong, passing from womb to womb, from darkness to (greater) darkness, such a bhikkhu undergoes suffering hereafter for certain.
"As a cesspool filled over a number of years is difficult to clean, similarly, whoever is full of impurity is difficult to make pure. Whoever you know to be such, bhikkhus, bent on worldliness, having wrong desires, wrong thoughts, wrong behavior and resort, being completely united avoid him, sweep him out like dirt, remove him like rubbish. Winnow like chaff the non-recluses. Having ejected those of wrong desires, of wrong behavior and resort, be pure and mindful, dwelling with those who are pure. Being united and prudent you will make an end to suffering."https://www.accesstoinsight.org/tipitaka/kn/snp/snp.2.06.irel.html
Here is a story of a monk being forced out of a recitation of patimokkha;
Revered sir, let the Lord recite the Patimokkha to the bhikkhus." When this was said the Lord remained silent.
When the night was (still further) advanced and the middle watch had ended, a second time the Venerable Ananda arose from his seat... and said to the Lord: "The night is far advanced, revered sir, the middle watch has ended and the bhikkhus have been sitting for a long time. Revered sir, let the Lord recite the Patimokkha to the bhikkhus." A second time the Lord remained silent.
When the night was (yet further) advanced and the last watch had ended, as dawn was approaching and the night was drawing to a close, a third time the Venerable Ananda arose from his seat... and said to the Lord: "The night is far advanced, revered sir, the last watch has ended; dawn is approaching and the night is drawing to a close and the bhikkhus have been sitting for a long time. Revered sir, let the Lord recite the Patimokka to the bhikkhus."
"The gathering is not pure, Ananda."
Then the Venerable Mahamoggallana thought: "Concerning which person has the Lord said, 'The gathering is not pure, Ananda'?" And the Venerable Mahamoggallana, comprehending the minds of the whole Order of bhikkhus with his own mind, saw that person sitting in the midst of the Order of bhikkhus — immoral, wicked, of impure and suspect behavior, secretive in his acts, no recluse though pretending to be one, not practicing the holy life though pretending to do so, rotten within, lustful and corrupt. On seeing him he arose from his seat, approached that person, and said: "Get up, friend. You are seen by the Lord. You cannot live in communion with the bhikkhus." But that person remained silent.
A second time and a third time the Venerable Mahamoggallana told that person to get up, and a second time and a third time that person remained silent. Then the Venerable Mahamoggllana took that person by the arm, pulled him outside the gate, and bolted it. Then he approached the Lord and said: "Revered sir, I have ejected that person. The assembly is quite pure. Revered sir, let the Lord recite the Patimokkha to the bhikkhus."
"It is strange, Moggallana, it is remarkable, Moggallana, how that stupid person should have waited until he was taken by the arm."https://www.accesstoinsight.org/tipitaka/kn/ud/ud.5.05.irel.html
Vinaya contains a lot of procedures that are conducive to getting along. It restrains bad behaviour in precept and opens opportunity for confession & making known a suspicion and outlines procedures of censorship, rehabilitation and expulsion.