Find the transaction you want to get rid of:
listunspent
Note the "address" (for later), "txid" and "vout" lines.
createrawtransaction \
'[{"txid": "THE_TXID", "vout": VOUT}]' \
'[{ "tb1qryakg74re8an5yc99nsznj4f7t94rghk6m986l": 0}]'
Note the result as RAWTX. The address used in this raw transaction is not important. 0 is sent to it. All goes to mining fees. But it has to be a valid address.
Now get the private key for the "address":
dumpprivkey "address"
Note the result as PRIVKEY.
signrawtransactionwithkey RAWTX '["PRIVKEY"]'
Note the "hex" result as SIGNEDRAWTX and send it:
sendrawtransaction SIGNEDRAWTX
See testnet example of a dust transaction removal: https://blockstream.info/testnet/address/tb1qqg24ah8qre3uzutq2sju9jz70xnmvjsq5r67uy