To learn how to write an element of chivalry into fantasy, first ask why it's important. Fantasy writers establish a code of conduct to help readers understand who is good and who is not. Fantasy realms open opportunity to create a different code of ethics. Although ethics differ from world to world, they still need to be anchored in the real world to allow the reader to relate.
In medieval times the church fostered a code of chivalry. Fantasy writers today often include historically chivalrous themes including basics like upholding the honor of women and the protection of the weak. How that's accomplished will be determined by the code of conduct established.
For example, in my fantasy novel Windwalker, the young protagonist is taught by his grandfather not to stare at the bumblefoot but to treat her with respect. This may sound more like good manners, but this behavior goes against the queen's edict, which declares a bumblefoot baby be killed at birth. Instead of treating her with respect, the law requires she be reported. The code of conduct reflected in the hero's actions at a young age goes against the law. Readers know breaking the law is bad but are forced to make a moral stand. Do they agree with the law? When the protagonist doesn't report the girl, it's no longer the grandfather's ethics but his own. Circumstances introduce what is right and wrong; while the fantasy writer motivates the reader to take sides.
Chivalry found its birth amid the obligations of service and loyalty within feudalism. This righteous code of conduct actually curbed some of the bloodletting violence of the medieval era. However, an adulterated version of chivalry carried crusaders on savage quests that left behind scars still festering in some cultures today. With all that in mind, how does chivalry work when writing fantasy?
Tomorrow we'll look at adulterated chivalry in fantasy writing.