Yes. Two recipes for you:
[independent clause] + [comma] + [conjunction] + [independent clause]
[independent clause] + [conjunction] + [dependent clause]
Profit is accounting opinion, but cash is fact.
Independent clauses always have a subject and a predicate (they can "stand on their own" if disjoined from the compound sentence. Thus,
Profit is opinion. Cash is fact.
Dependent clauses typically share the subject with a prior part of the sentence, as in the first sentence of this example:
Profit is the opinion of the accounting department and has only a tangential relationship to available cash. Every profitable business remains subject to failure due to inadequate cash flow.
However, contrasting elements are also set off by commas. Thus,
Cash is not just an opinion, but a fact.
Because "but" is by its very definition a tool for encoding contrast, the clauses it serves to join must almost always be separated with a comma before the "but."
An example where but is not accompanied by a comma:
It was all but a dream.