how do i set someone up as an affiliate to earn on sales?

How do I set someone up as an affiliate so that they can earn a % on sales of a course that I am running? The course is set up on my website so people can book/pay there, need to be able to track the sales that come in via my potential affiliates. Thank you