Can I sign a Bitcoin transaction without connecting my wallet to the internet?
Your wallet sits on an offline machine and you're afraid connecting it to sign will expose your keys.
**A PSBT carries everything a signer needs, so the wallet that signs can be fully offline.**
What a PSBT is and why it lets you sign offline
A PSBT (partially signed Bitcoin transaction) is a file that describes a transaction without finalizing it. It includes the data a signer needs to add a signature, whether that wallet is connected or not.
BIP-174 says it literally: “The signer can be offline as all necessary information will be provided in the transaction”. That's the source: the format was designed so signing doesn't depend on a connection.
What you need to actually sign offline
The format allowing it isn't enough: your wallet has to support PSBT and give you a way to load it without internet, for example with a QR code or an SD card.
After signing, you export the signed PSBT and broadcast it from a device with connection. Your key never goes online: only the file travels.
When this helps and when it doesn't
Offline signing helps when you want to move funds from a cold wallet without exposing your key to the internet. It's the standard path for a hardware wallet or an air-gapped computer.
It doesn't help if your wallet doesn't handle PSBT or if the file comes from someone you don't know: then you have to inspect everything carefully before signing.
Signing offline doesn't prove that the PSBT someone handed you is safe
Just because the wallet can be offline doesn't mean the PSBT is trustworthy. If you received a file, check destination, amount and fee in the wallet before signing. Being offline removes the need to see the chain, not the duty to verify what you are signing.
Source: BIP-174, Abstract