At the Passover meal Jesus shared with his disciples He tried to prepare them for the persecution He was expecting from the Jewish leaders and the Romans. Jesus had done nothing wrong, but it was the good He had done that was a threat to the power and wealth of the people in control.
Jesus was also preparing His disciples to carry on his mission and teach His message after he was gone. And they could only do that if people knew they were his disciples by the way they loved one another, and loved others.
Jesus knew His disciples would face the same threats and treatment by the people who wanted to stop Him. Jesus also knew that true love can be difficult for many reasons: people do evil things; people betray us; people must be corrected or punished for inappropriate or unacceptable behavior; people are an imminent threat to us or others. Love is not easy, but Jesus demonstrated it is possible.