Transaction fee is the difference of the sum of transaction inputs minus the sum of transaction outputs. The extreme cases are:
- both sums are equal, meaning the transaction fee is then zero. Standard nodes won't relay such transactions as currently the minimum standard transaction fee is 1 sat/vB (a mining pool can mine transactions with zero transaction fee; that's not against the protocol).
- the sum of outputs is zero, e.g. a single OP_RETURN with 0sat which translates to the transaction fee being the same as the sum of inputs (the miner won't mind such a present if the sum of inputs is reasonably high and not just a few hundred sats).
It's important to fully understand the UTXO (unspent transaction output) transaction model of Bitcoin to avoid costly mistakes. E.g. if you want to partially spend an UTXO of a paperwallet (let's assume there's only one UTXO that has been sent to the paperwallet's public address), you have to send the change which you don't want to spend back to the paperwallet's address (which would be address re-use; not immediately harmful) or to an address of another paperwallet address or other wallet address.
The costly mistake would be as follows: the paperwallet "holds" 1BTC; you want to spend half of it to some destination address; you create a transaction which spends the 1BTC and sends only one transaction output of amount 0.5BTC to the destination address; nothing more. The result is a transaction fee of 0.5BTC which no miner would mind collecting, while you'll need a bucket to collect your tears.
If you need to lookup Bitcoin basics or need to dig deeper, I highly recommend the website https://learnmeabitcoin.com!