The quintessential analogy for children is "little sponges". As a parent, I'd go a step further and use "lumps of clay". Each child has their own distinct way of operating and reacting to things, but, on the whole, children will be molded into whatever image their parents provide.
This holds true in nearly all areas, ethics included. The short answer then, is to display ethical behavior. As children grow, they will model their behavior after yours.
Ethics, unfortunately, is not such a simple issue that a parents' behavior can display it. We often make exceptions, especially with young children, on what is "fair" and what is "unfair". This leaves many children with an idea that "fair" means "right", undermining the development of ethical behaviors before they can begin.
In it's simplest form, ethics can be defined as "a system of right and wrong". As parents mold their children into ethical adults, they should focus on what is absolutely right, and shift away from what is fair. Any parent, or anyone who has been around young children for any length of time, has probably heard them exclaim, "But it isn't fair!" Following that is usually one of many pithy adult responses, focusing on things not always being fair.
Rather than stopping the dialogue with closed statements, ask the child what is right and what is wrong. They should first consider the action that they thought was unfair (someone getting an extra cracker? a sibling taking the toy they wanted? grandma turning the channel on the TV?) and decide if it was wrong (did that someone get the extra cracker by taking it, or was it just luck of the draw?). If it was wrong (unethical), they should look for resolution on that basis; if the action is strictly unfair, they should ask nicely that it be dealt with fairly.
After they have made this judgement, ask them to examine their own behavior. Were they rude or inconsiderate when they cried foul? Did they whine or cry? If they are going to judge the actions of others, they must also be taught to examine their own. This may be difficult with very young children, who are prone to say thing like "yeah, but she" and divert from their negative behavior. Be consistent in helping the examine their behavior and it will eventually become second nature for them to examine their own actions, hopefully even before they take them.
By emphasizing early in a child's life that things are not "fair" or "unfair", but "right" and "wrong", they will have a solid foundation for ethical behavior in the future. Not only that, they will become mindful of their own actions and reactions to the apparent injustices of those around them.