wp_mail() is not working in localhost

wp_mail() falls back to php’s mail() function which requires a configured MTA (Message Transfer Agent) on your host. So either you install and configure such a MTA. If you’re running a Linux like OS, SSMTP is an easy solution on which you can use any mail-provider to send your system mails via SMTP. Another MTA would be Sendmail, a full featured, yet difficult to configure MTA.

Or you simply use a plugin like WP Mail SMTP which implements a direct SMTP connection in PHP and bypass the mail() usage.