Hamilton was responding to news coverage showing scenes of crowds gathering worldwide, despite advice from their governments.
"I'm so sad to hear of the amount of deaths happening around the world," Hamilton wrote on social media. "I know most of us are limited with the knowledge of why and how this has happened.
"There is nothing we can do about it either way except to try to isolate ourselves, stop ourselves from catching it and spreading it.
"There are people out there still going to clubs and bars and large gatherings which I personally feel is totally irresponsible and selfish."
He added that he's praying for medical staff and other "heroes" who are putting their lives at risk.
"I'm praying for my family's safety each day but I'm also praying for you out there.
"I'm praying for those working at the local stores, deliverers, doctors and nurses who put their own health at risk to help others and keep the countries running. Those are the heroes. Please stay safe people."
In an earlier message to fans the world champion wrote that he is fit and healthy and has been in self-isolation since the Australian GP.