Doctor's legally can't tell your family or friends or next of kin etc, and it's the only way you can really get any help; they are always first port of call, and often advise to to take prescribed anti depressants etc to lessen the intensity of your thoughts. There are different avenues that your doctor should go down in order to get you 'help' - usually just a referral to a Community Mental Health Team. If you tell a doctor that you have a plan (i.e. a time and date and place) to take your own life then they should contact a Crisis team who will come out to you immediately or at least within 24hrs.
There are ways to get through and past self harm. I always found distraction helped me, and being with other people. Also, planning my day to be as full as possible so there was no available opportunity in which to self harm.
The reason for self harm is different for everyone - punishment, emotional release, the list is huge. The point is that you need to discover why you want to / do self harm in order to over come it.
With self harm comes immediate 'satisfaction' but years down the line you'll regret the end result.
Talk to someone. x