A virtuous action is not merely any action which, somehow or other, will lead to happiness. We do not display virtue when we do something that happens to be good, but we must act with a deliberate desire to perform our cuntion as human beings properly, that is, to perform it voluntarily and in full awareness of the fact that there are possible alternatives, which, however, we reject in deciding to act the way we will.
The Greek word Aristototle uses for this process is proairesis, which literally means "forechoice", "A choosing (one thing) before, ie, rather than (another)," and without it no action can have moral value. Aristotle's final definition of the concept at the end of his discussion in III. 2-3 is "a deliberate desire for things that are within our power: we arrive at a decision on the basis of deliberation, and then let the deliberation guide our desire." It is, in other words, a thoughtful organization of our desires -- not of all desires, but only of those which we are capable of fulfilling through our own efforts -- without which no action can be termed "virtuous."
But in order to have virtue it is not sufficient to exercise this proairesis or "choice" of acting well only on a number of isolated occasions. Virtue is, for Aristotle, a hexis (literally, "a having," "a holding," "a being in a certain condition"), something so deeply ingrained in a person by constant habit that he will almost automatically make the morally right choices on every occasion, rejecting at the same time and equally automatically all the alternatives as wrong. Virtue will thus be a firmly established characteristic of the person, and the aggregate of all his characteristics will constitute his character. -- from the Introduction to Nichomachean Ethics by Martin Ostwald