`transfer` and `send` forward only 2300 gas, which breaks with contracts whose `receive` does real work. The modern default is `call` with an explicit success check, combined with reentrancy protection.
(bool ok, ) = payable(to).call{value: amount}("");
require(ok, "ETH transfer failed");Better still, prefer the pull pattern: record what someone is owed and let them withdraw it themselves.