Stacking rules (CatalogPricingRule) for discounts

Hi, I am a beginner with my Square POS and would really like to implement this code for my business, but do not know really where to start. Any help would be greatly appreciated!