In those cases, you either negotiate upfront before you start that you are only available for 3, 4 or five days a week or whatever number you want. Or you state at some point that you want to reduce your hours to whatever figure suits you, in which case there is an opening for another person to fill those now-unstaffed hours.
If the employer is only open for business 40 hours (5 x 8 hours) a week, then there is a situation which is more difficult to vary. But it's still doable to have two or more people sharing that single position: that's called "job-sharing".