How to disable libsass and enable dart sass once installed?

The topic that you linked to has the following sections:

The example section contains an example of how to use it.

I trust that your installation method gives you this when you run hugo env:

hugo v0.118.2-da7983ac4b94d97d776d7c2405040de97e95c03d+extended linux/amd64 BuildDate=2023-08-31T11:23:51Z VendorInfo=gohugoio

Not to put too sharp on edge on it, but guessing is rarely a great strategy. If you would prefer to handle the transpiler option in your site configuration, create a custom parameter:

transpiler = 'dartsass'

And then use that in your template instead of hardcoding the value.

Finally, the topic you linked to is no longer the canonical source of documentation, as noted at the top of the topic. See instead.