To enable costing method for products such as real costing and average costing, we need to enable the feature checkbox available in the below screenshot.

Navigate to the form from Settings>> General settings>> Purchases and apply the changes.