formality
Something done just because rules or customs say you should.
A formality is something done mainly because custom or rules require it, not because it serves a real purpose in the moment. When your teacher already knows you're going to the bathroom but you still have to raise your hand and ask permission, that's a formality: everyone knows the answer, but you follow the procedure anyway because that's how things are done.
Some formalities help society run smoothly. Shaking hands when you meet someone, saying “thank you” when someone helps you, or standing when an important guest enters a room are all formalities that show respect and make social situations work better. A wedding ceremony contains many formalities: walking down the aisle in a specific order, exchanging rings, and saying particular words.
But sometimes a formality is just going through the motions. If your school holds a vote on whether to have recess (and of course everyone will vote yes), the vote itself is really just a formality. When something is called a “mere formality,” it means the outcome is already decided, and you're just following the required steps.
In everyday speech, people might say “let's skip the formalities” when they want to get straight to the point without all the usual polite introductions and procedures. The word can also describe the general atmosphere of a situation: a dinner party might have more formality (everyone dressed up, fancy plates) or less formality (pizza on paper plates, everyone in jeans).