The utilitarian principle says your action is ethical only if you can rationally believe that it maximizes the total expected utility of everyone it affects.  It must create at least as much utility as any other option that passes the generalization test.

Utility can be understood as happiness, or any other condition(s) you regard as intrinsically valuable.  It is the ultimate end (or ends) toward which all of your actions are means. 

Total utility is the algebraic sum of everyone's utility, where negative consequences are regarded as having negative utility.

When the consequences of an action are uncertain but probabilities can be estimated, expected utility is the weighted average of utilities in all possible outcomes, where the weights are the probabilities of the outcomes.

An act that is consistent with the utilitarian principle can be said to pass the utilitarian test.

For a fuller explanation, watch the video Rational choice II (or read the transcript).  It is part of an online ethics tutorial that consists of the following 30-minute sessions: