There are three moods, the indicative, subjunctive, and imperative.

The indicative mood indicates that the action is a fact. It is also used in asking questions.

The subjunctive mood is less used in modern than in old English. It is most commonly found in clauses beginning with if, though if is not to be regarded as the sign of the subjunctive in any such sense as to is the sign of the infinitive.

The subjunctive were should be used in purely hypothetical clauses such as "If I were in your place."

The subjunctive be should be used in the hypothesis or supposition of a scientific demonstration,

If the triangle A be placed on the triangle B.

The subjunctive without if is often used in wishes or prayers,

God forgive him.
O, that my brother were here.

The subjunctive is sometimes used to express condition,

Had you not been a coward, you would not have run away.