The unified cgroup hierarchy, cgroup v2, became the default in Fedora 31 in 2019 and in Debian 11 and Ubuntu 21.10, and it is what current mainstream distributions boot with. Tools and documentation written for v1 look in the wrong place.
The filesystem layout differs: v1 mounts one hierarchy per controller under /sys/fs/cgroup/memory, /sys/fs/cgroup/cpu and so on, while v2 mounts a single tree at /sys/fs/cgroup with controllers enabled per directory through cgroup.subtree_control. File names changed too, so memory.limit_in_bytes became memory.max, memory.usage_in_bytes became memory.current, and CPU bandwidth moved from cpu.cfs_quota_us and cpu.cfs_period_us to a single cpu.max holding both numbers.
Detect the version with 'stat -fc %T /sys/fs/cgroup', which prints cgroup2fs on v2 and tmpfs on v1. Under systemd the supported way to set limits is resource control directives such as MemoryMax, CPUQuota and TasksMax in the unit, not writing to the files directly, because systemd owns the hierarchy and will overwrite manual edits on the next reload.