Using the theory of the firm diagram, firms select a quantity such that Marginal Revenue (MR) is equal to Marginal cost (MC).
Using the diagram, as shown, you draw a vertical line up from this intersection of the MR and MC curves, until it meets the Average cost curve (AC). In doing so, you will also have passed the Average Revenue curve (AR). Draw a horizontal line from the Average Revenue curve to the y axis, and likewise from the Average cost curve to the y axis. The firms profit level can be shown as the rectangular area you have just formed, between the Y axis, Average revenue and Average cost curves (This will be labelled and shaded on the diagram)
Many students understand this with practice, but struggle to remember without understanding the reasoning behind it. We assume all firms aim to maximise profits. The profit maximising level occurs where MR and MC intersect, as intuitively, if MR was larger than MC, it suggests a firm can increase profit by producing an additional unit, as the marginal revenue by doing so exceeds the cost. Alternatively, if MC is higher than MR, then it implies a firm has made a net loss by producing their last unit, so would be making higher profits by producing less. The only feasible level to maximise profits is therefore where MR = MC.