Profit will be maximized when total revenue (TR) exceeds total cost (TC) by the greatest amount.
This is also the point when the additional revenue of producing one more unit is equal to the additional cost of producing one more unit and the additional cost is increasing. In other words, profit is maximized when marginal revenue (MR) is equal to marginal cost (MC) and MC is increasing.
The following diagram compares the total vs marginal approaches to looking at profit maximization for the single-pricing searcher.
When MR = MC, no additional net revenue (i.e., profit) will be added to total profit. That means total profit cannot go any higher and is at its maximum.
Comparing MR with MC (instead of comparing TR with TC) to determine the profit-maximizing output focuses our attention to the incremental step ahead. It is like looking ahead only for the next 100 feet when driving on a superhighway. When MR exceeds MC, producing more will add to total profit. Similarly, when MC exceeds MR, producing more will subtract from total profit.
But comparing MR and MC alone would not tell us whether the profit is positive or not. Marginal cost looks at only costs that change with output (namely variable costs). For profit to be positive, total revenue must be high enough to cover also fixed costs (see Fund Raising at the Margin).