Many employers are looking for the hours to be filled, without necessarily specifying that each employee works the whole hours. That is especially the case for enterprises that work 7 days a week or (say) 12 hours a day.
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".
This perspective looks at programming like factory work: output == hours worked * some factor.
But in reality, most employers in tech that have allowed some or all employees to reduce their hours have found no productivity loss, or in some cases productivity gains. That's why often employers are OK with leaving the salary the same when moving to 4-day weeks.
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".