Self-harm is so distressing to parents and at times they react in a way which is not the best response. The way that someone responds when a young person is first brave enough to tell someone that they are self-harming will affect whether they open up about it and accept support in the future. The best way to react is calmly. Explain to the young person that you understand that they must be feeling really distressed to have self-harmed and that you want to help understand the issues that are leading to this to help them address them and assist them in learning new ways to cope. Do not push them to tell you everything there and then but encourage them to communicate with you in some way, (through text, writing or talking), as and when they feel calm and ready to do so. Reassure them you will not over-react and ask them if there is anything they would like you to do or not do when they speak to you.
I would let the young person know there are helplines such as Samaritans and ChildLine that they can access at any point confidentially and that there are apps they can download for their phone which will help them distract themselves when they are feeling distressed.
It is sensible to lock away medications if you have a young person at home who is self harming.
I would try and form a communication system with them that allows you to have some idea of their risk. For example, see if you can get them to agree to you asking if they are red, amber or green morning and night. Sit with them to understand what the different traffic light colours would mean and how they would want you to react to each colour.
If you are very worried about their safety, do not delay in accessing help.