How do you make money on transactions with a bitcoin node? I saw somewhere this was possible with a lightning node. Maybe there are other ways? I tried installing the Electrum wallet, but it never earned a profit.
With Electrum wallet, you can not run a Bitcoin node, either a full node or a prune node. Because Electrum is a SPV wallet. [1]
To run a full node or prune node, you must use wallet like Bitcoin Core but Bitcoin node does not earn bitcoin. The Bitcoin network is Proof of Work so miners work with their hashrate to find blocks and confirm transactions. They get Bitcoin block rewards include block subsidy and transaction fee.
With Lightning Network channel, read the explanation from pooya and [2]
[1]
Simplified Payment Verification wallet.
[2]
[Table] All Lightning Network Threads In One Place