PulseSensor

Use the example code which came with your sensor.

If you didn't get any example code, then buy a different one which does have examples of Arduino code.