I know we can do this by menu "File - Backup", but how can we get the private key of the address(or something else we can restore wallet) then write it down or print it out?
You want to use the
listdescriptors true RPC command. It will list all the output descriptors that the wallet consists of, together with their private key material (typically, in the form of xprvs). These descriptors can be imported into another wallet using the
importdescriptors RPC to get an equivalent wallet.
You can backup your wallet on bitcoin using the "backupwallet" RPC or "File > Backup" on GUI
$ bitcoin-cli -rpcwallet="wallet-01" backupwallet /path/to/Backups/backup-01.dat
More information on managing your wallet can be found at https://github.com/bitcoin/bitcoin/blob/master/doc/managing-wallets.md#14-backing-up-the-wallet