Localhost WordPress not recognizing my online WordPress account

WordPress do not work like Facebook or Twitter. Each WordPress installation is a separate application, it has its own database where users are stored, each installation is independent of one another. Your localhost installation of WordPres has no connection to the one on the server they are two entirely different entities.

But you can copy all contents from your server to your local installation, it is called migration. Here is a very in-depth guide on how you can do that: https://premium.wpmudev.org/blog/moving-wordpress-site/