How do you know that it is not working?
Have you tried opening "Samsung Health" on the watch, scrolling down and clicking on hearbeat, and clicking the "Measure" button.
Have you checked the bottom of the watch to see if dirt is blocking the sensor? Or to see if the sensor is mechanically damaged?