You should try and encourage them to get some help or advice, initially from a GP. Unfortunately, your friend/relative might not want to see the GP as they might not think they are unwell or think that the GP will not be able to help them. Try to do your best to put yourself in your friend/relatives shoes and understand how they feel. Try and always bring the topic up at the right time when you are both calm and remember to be patient.
You could offer to go with them to a GP or offer some suggestions as to why they are feeling/acting this way. Ensure that they know that anything you tell them you will keep private and that they have your trust.