The course materials (e.g. video lectures, discussions, etc.) are usually free, but certain features like graded assignments, certificates, and mentorship may be paid features. Course and/or certificate costs vary for each MOOC provider. Courses may be available either on a subscription basis or for individual purchase.
Free access may be called audit mode. If you are not clear on how to sign up for Coursera courses for free, here is a guide from Class Central: A Guide on How to Sign up for Coursera Courses for Free Other course providers may have a similar process for free access.
Also see Will I receive a certificate for completing a MOOC? and Are Coursera courses free? An investigation by Class Central discovered 1150+ Coursera courses that are still completely free, without a certificate.
A small number of courses are not free. These are indicated by a small green $ symbol on Class Central.
If you want a certificate but cannot afford the cost, some providers offer financial aid to needy applicants. See Can I get financial aid for MOOCs?