"Be peaceful" should be the easiest part to grasp. Don't initiate violence, and don't threaten to initiate it.
"Be courteous" is hard for some upper class people to understand, because they think civility is a bourgeois notion. Every community has rules of behavior that apply within the group. A common expression of that among working class southerners is "Didn't your mama teach you no manners?" The best people in every group apply those rules to the treatment of strangers too.
“Obey the law” is hard for rebels to understand. It doesn't mean submit to authority. It's a tactic for protest—disobeying the law gives the authorities an excuse to break up your gatherings and imprison anyone there. Obey the law, and you cannot be silenced. Because Malcolm, after he left the Nation of Islam, respected Martin Luther King, who broke laws strategically, I suspect Malcolm would say this part of his code, like any code, is a principle that may be broken if you're sure you'll be more effective by breaking it.
"Respect everyone" is the advice that St. Peter also gives. It is the definition of civility, the tool of diplomats. It has nothing to do with good manners—good manners call for you to avoid unpleasantness. Civility lets you confront any unpleasantness. Civility is the guideline for people who are ready to go to war as well as people who are willing to make peace.
"If someone puts his hand on you, send him to the cemetery" is the hardest part to grasp for pacifists and war lovers. His “if” is essential. Has no one laid hands on you? Stay peaceful, courteous, and respectful. Online, no one can put a hand on you. In civil meetings, no one will put a hand on you. We know he meant "puts his hand on you" literally because he was civil to everyone, including George Rockwell, founder of the American Nazi Party.
But if someone puts a hand on you, you are not obliged to respond with violence, nor may you use violence after that. Like the Bible's "an eye for an eye", it defines the greatest response you may choose. Just as "eye for an eye" says you may not take two eyes for one, "if someone puts his hand on you, send him to the cemetery" says you may only use lethal force while you're defending yourself. As soon as your opponents are incapable of laying hands on you or have stopped laying hands on you, the first half of the code applies: respect them.
Possibly relevant: A little about America's idea of cowboys and traditional male values. Cowboy codes of the early 20th century have a lot in common with Malcolm's code.