Such things can be difficult to listen to. If someone does start to tell you something, remember that it is not their fault that this has happened to them. Try to be supportive, but if the conversation is upsetting you, tell them that you think they should speak to an adult about this.
Don’t agree to keep secrets. This will not help the child in the long run. If you tell your parent(s) you will eventually be helping them get the support they need. You can be a good friend to them, but it is not your responsibility to cope with everything alone.