Unused RAM is wasted RAM. macOS (and Windows for that matter) allocate a set amount of RAM to itself in order to run smoothly. Windows usually allocates half, whilst macOS 2-8GB depending on the amount of available RAM.
If your usage needs the 24GB, macOS will notice and allocate less RAM for itself.
Again, unused RAM is wasted RAM.