One of the main sources of bad kamma in Buddhism is doing wrong to your parents and not taking care of them. Buddha said it is very very hard to repay your parents, however how should one behave if he or she has bad parents? Maybe a parent that was an alcoholic or didn't take care of him properly, abandoned him, banned from his house or maybe stole from him? There are countless possibilities, what to do?
My father was an alcoholic, and I suffered a lot of grief from him - so I might as well try and answer this one.
The way my first teacher taught me about this (back when my father was still alive and I still encountered him a lot) the circumstances like this come from our karma, specifically from our attachment to decency and spirituality. The more we are attached to decency and to spirituality, the more we hate people who are indecent and lowly, the more we will have to face them. So the only way to stop this particular kind of painful circumstances, is to drop the attachment to decency and to spirituality, by no longer putting decency and spirituality above love and above existence itself. This was the teaching method my first teacher employed, very effective.
The way my last teacher taught me about this, long after my father passed away, is that in such cases freedom comes from forgiveness, understanding, the intent to stop the chain of suffering. We should understand that family issues are passed down the chain, although not necessarily in the same form. When father has certain issues, the child will have certain other issues - that will affect lives of their children and so on. Even my father's behavior was not his own, he inherited it from his childhood family - his father was a very violent guy, a commander of a penal military unit, a place where the criminal soldiers served. Behind a violent alcoholic there is often a hurt little boy. This is important to understand.
So these are two lessons from my Buddhism teachers, one is to let go of attachment to decency and spirituality and abandon hatred and aversion based on them, and two is to understand your parent's own background and suffering.
As to what to do, I think the best way to work with such people is as if you were working with a child. No matter how adult they look or pretend to be, if they act like that they are still immature, far from it. So working with them like you would with your own child, with tough love, compassionate but strict, seems to be the best course of action.
Even if your parents abandoned you the day you were born, you still owe them. The only way to repay them fully is to make them understand the Dhamma. If your parents are alcoholic, take them for rehab. If they steal money, don't keep money where they can find. Likewise, address each issue accordingly. Advice them with the Dhamma and show them the right path without getting angry.
There is a aspect of Buddhism which actually views difficult people (including parents) as being helpful and we should be grateful to them. Forbearance (kṣānti) is one of the six perfections. To illustrate let me quote from the Bodhicaryāvatāra, Perfection of Forebearance (verse 107)
So we should be grateful to difficult people even if they are, well, difficult.
But realistically we aren't all able to do this, certainly not in the initial stages of practice. Also difficult relationships with parents particularly colour our lives and are difficult to get past. When I have had difficult relationships (not with parents admittedly) then sometimes the only thing to do is take yourself out of that situation until such time as you are better able to cope positively with it - and if that time never comes well at last you are out of that situation and maybe better able to practice positively generally.
Also Buddhist teachers like Jack Kornfield actively recommend counselling to go alongside Buddhist practice and the two work side by side. This article illustrates Jack Kornfield's position which I'll quote a brief section
However bear in mind that....
In my opinion, when things come up in meditation practice, why not use every facility that is available to you to come to terms with it? I appreciate might be a controversial view. People are obviously welcome to disagree with.
Repaying the kindness of parents applies when acts of kindness has been done.
When the Buddha spoke about this, he was speaking in a general case, i.e. most parents have been very kind, which means they have done acts of kindness, like take care of children, bear them, love them unconditionally. However, nothing has inherent existence, this means that parents are not, by their nature of being parents, people who have done such acts of kindness - some parents are cruel, and may do very few or no acts of kindness towards their children.
In this case, we should take the Buddha's advice on similar "friends": "The friend who is all take, The friend of empty words, The friend full of flattery, And the reckless friend;
These four are not friends, but enemies; The wise understand this And keep them at a distance As they would a dangerous path." (DN31)
Likewise, we can show compassion to a parent, and try to guide them to the Dharma, but if their karma is clearly not ripe, they may not be worth the effort, "A fool can attend on a wise man even for whole his life, he will not understand the Dharma, like a spoon does not know the taste of the soup." (Dhp. 64).
Anyone who has experience with, for instance, a "reckless" parent, who may be an alcoholic, knows that you cannot just "take them to rehab" and take care of them - they can only help themselves. The best thing you can do is keep a distance. If this isn't possible, and you are still staying at home, ideally you take the advice of Crab Bucket, and practice patience, but try to avoid them when they are drunk and try to stay pleasant, but distant, unless they become more agreeable.
There is a tendency for some people to want to be super heroes, but we also have to be realistic. The Buddha was realistic too, that's why he simply recognised that sometimes we just have to stay away from such people.