Nobody likes paying attorneys' fees. Even if you successfully prosecute or defend a lawsuit, the legal costs are likely to make it a Pyrrhic victory.
The basic rule in the U.S. is each party is responsible for his or her own attorneys' fees regardless of the outcome of the case. This is known as the American rule. In contrast, the English rule, also known as the "loser pays" rule and followed in England, Canada and European countries, has the loser pay his or her own and the prevailing party's attorneys' fees. The specter of paying not only your legal fees but also the other party's legal fees causes litigants to be more circumspect when deciding to prosecute or contest a suit and increases pressure to reach an early settlement. On the other hand, the American rule is more in keeping with the traditional American view that everyone should have ready access to the courts.
Although every state except Alaska generally follows the American rule, contracting parties can make their own agreement regarding recovery of attorneys' fees, and courts typically will uphold those contract provisions. Consistent with the principle of "freedom of contract" (meaning parties generally are free to negotiate their own contract terms), you can deviate from the American rule simply by adding a provision in a contract governing payment of attorneys' fees.
For example, you can reverse the American rule by adding a sentence stating the prevailing party is entitled to recover attorneys' fees in the event of a dispute. Inclusion of such a provision when drafting or negotiating a construction contract is the most direct way you can deviate from the American rule if you desire to do so but can be a double-edged sword.