Some people intentionally hurt themselves in a number of different ways and for a variety of reasons. Often people choose to self-harm as a way of expressing some very difficult feelings that they are struggling to put into words; it can act as an outward expression of inward pain. If you or someone you know is struggling this way, it is really important that you speak to an adult who you trust.
God loves you deeply and wants to stand with you in your pain. In the Bible we see again and again that people turn to God in their darkest moments. You can do that at any time.