The simplest solution is, indeed, scheduled backups with media air-gapped after backup. Tedious, and you actually have to do it regularly; but external HDDs are cheap and nothing can scribble on a volume that isn’t even connected, much less mounted.
The lazier-but-not-as-safe approach would be to keep the backup storage(whether direct or network attached) connected at all times; but ensure that your account isn’t allowed access to it; and only root/administrator and the account that the backup program will be running in can touch it.
This is useless against ransomware that is coupled with a privilege escalation(either vulnerability or social engineering); but the whole point of ransomware is to exploit the fact that the files people care about are also the files that they own, so much(but not all) ransomware doesn’t actually try to break out of your security context and just hits everything it can reach within it. Any such non-escalated malware won’t be able to access the backup volumes, since you aren’t able to access the backup volume as ‘you’.
If you feel like going old school and exotic, Plan 9 had some pretty neat filesystems for back purposes(and, since you can use them either in a VM or via Plan 9 from userspace, this might actually be relevant even though Plan9 isn’t, alas): the ‘Fossil’ filesystem has nice built-in support for taking snapshots; and the ‘Venti’ filesystem is WORM, so the two are typically used together with snapshots from Fossil periodically being archived to Venti. Because it really doesn’t do delete/rewrite, you can run Venti on actual WORM media(which mostly means painfully expensive tape drives with firmware that enforces the write-once restrictions); but it also works on normal HDDs; and can only be overwritten by escalating privilege enough to scribble directly on the block device or nuke the entire volume.
If you aren’t going to go with the simple-but-manual option; it’d probably be a good idea not to rely on direct attached storage. Fileservers are hardly invulnerable(and any competent ransomware will enthusiastically trash any network volumes you have access to); but having the separate OS, which doesn’t routinely interact with the internet and handle all the activities that tend to lead to infection, makes it more likely that OS-enforced privilege separation will be maintained, even if your primary computer is rooted. Direct attached storage, of course, is always at the mercy of your computer, so it will be vulnerable if something unpleasant breaks out of a limited user context.
(edit: if you are of even the mildly tinkering-y persuasion, the fact that most direct-attached storage is USB and designed to be safely removable(Windows has disabled write caching for external media by default since either XP or 2000, I’m not sure which OSX versions and Linux distributions do or don’t do it by default; but it’s a good idea there as well), it would be relatively easy and safe to get all clever and modify one of the USB hubs with per-port switches, like this one no specific endorsement just an example to allow the widget of your choice; arduino, rPi, anything with GPIO, bring USB-attached disks on and offline on schedule for you, without any manual plugging and unplugging. That definitely falls into “because I can” territory; and may not be worth the effort; but it is an option. You could do the same if the HDDs you are using have power switches of their own, as most 3.5in drives do.)