We don't usually do homework for people in this forum. I do not know what software you are using to display the graph, but most of the plotting widgets have the ability to transform the pixel coordinates of a mouse click into data coordinates. So you need to study the documentation for your widget to learn how to do that.

the distance in meter
If your plot is an ECG, then the x axis will be in seconds, not meters. So your distance between two peaks will be in seconds, and you can use simple math to turn that into heart rate (BPM).