i am trying to understand how to do it before backup
The extra will backup your database and all files and offer links to download it, or it can be found in the assets/backups folder. To restore you would just need to empty the current database, and import the backup database. If you need to also restore files then just transfer the files back to your server from the backup.
how to extract archives and import database using console commands?
Usually you would use something like phpmyadmin (found in cpanel or plesk if you have access) to delete/edit/import or anything else to do with your database.
i have only access to modx