As an administrator go to Account and Settings, and select the E-commerce tab to create your coupon.
You can type the code name (1), specify the period that this coupon can be valid (2), how much discount this coupon will offer (3) and how many times this coupon can be used in total (4).
If you leave the field " Valid for courses" empty, then this coupon can be used for all the courses in your portal (5). If you enter the name of the course, then it can be only redeemed when a learner decides to purchase the specific course.
Share with your learner the coupon code, and when they are ready to purchase a course, they can redeem the code. By clicking to validate (6) the final price will show up on the screen (7), since the discount is applied directly to this transaction.