Download Bitcoin Core
Download the Bitcoin Core wallet from the official website (https://bitcoin.org/en/bitcoin-core/). Click Download Bitcoin Core and choose the version suitable for your system.
Before installation, disconnect from the Internet.
Install/Start Bitcoin Core
When the installation is complete and started, in the welcome interface, be sure to remove the check in front of the trim option. Because exporting is not supported in trim mode.
After launching the application, create a new wallet.

Wallet interface

Create a wallet
Enter the wallet name, such as mybitcoinwallet, and leave nothing else checked. Click Create. The wallet is now created.
Export wallet private key
At this time, click Receive → Create a new payment address, and you can see your address. Copy this address: bc1qryg8j44c9tnrmjtge3kmum2lug7qasjc8329nv

Select Window→Console from the menu bar. The following interface will appear.

Enter the following command on the command line of the console. You can export the private key. Copy carefully with paper and pen.
dumpprivkey bc1qryg8j44c9tnrmjtge3kmum2lug7qasjc8329nv

Verify wallet private key
Finally, let’s verify whether we copied it correctly.
Still in the terminal of this console, enter the following command. If the final result is null, it means you are right. If there is a problem, it will display: Invalid private key encoding (code -5).
importprivkey L56B6yfHkbRJwaHGbvVJyzaiNGkLyXMEyciXRiStgBcganANZ2yy

Note: Don’t forget to delete the wallet we just created. The path is as follows:
C:\Users{user}\AppData\Roaming\Bitcoin\wallets\mybtcwallet can be deleted entirely.
When we want to use the BTC controlled by this private key, we can import the private key into the hot wallet. After using it, transfer it to a new cold wallet again.