Why do I get the "Class 'Drupal\Core\Database' not found" error?
Drupal\Core\Database is the namespace of the class, which is not what the use statement requires. It needs the full-qualified class name, which, for that class, is Drupal\Core\Database\Database.

use Drupal\Core\Database\Database;


That is what Drupal core uses, for example in the DbLog.php file.

namespace Drupal\dblog\Logger;

use Drupal\Component\Utility\Unicode;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\DatabaseException;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Logger\LogMessageParserInterface;
use Drupal\Core\Logger\RfcLoggerTrait;
use Psr\Log\LoggerInterface;