Here's another tip: The Nikon CoolPix B500 uses individual batteries, not a rechargeable pack provided by Nikon or camera stores. Make sure that the batteries you put in are:
1) the right type (AA, D, etc)
2) placed in the slots properly (+ side of battery slot matches + side of battery)
3) fully charged
I had the same issue two times, both times, the batteries stopped working.
Another thing is that the Nikon Coolpix B500 is not a extreme temperature camera. Taking pictures in freezing or very hot temperatures can cause the camera to slow down or shut down.