1) How do you cultivate good?
2) what is good?
Elsewhere in the Dhammapada it suggests to cultivate good "drop by drop":
Think not lightly of evil, saying, "It will not come to me." Drop by drop is the water pot filled. Likewise, the fool, gathering it little by little, fills himself with evil.
Think not lightly of good, saying, "It will not come to me." Drop by drop is the water pot filled. Likewise, the wise man, gathering it little by little, fills himself with good.
Buddhism is called a "gradual training" -- and I think that's because it's taught gradually, step by step -- but I also think it's practised gradually, e.g. you might learn from moments of kindness or moments of suffering.
As for "what is good" one hint might be found in MN 61
Having done a bodily action, you should reflect on it:
'This bodily action I have done — did it lead to self-affliction, to the affliction of others, or to both? Was it an unskillful bodily action, with painful consequences, painful results?'
If, on reflection, you know that it led to self-affliction, to the affliction of others, or to both; it was an unskillful bodily action with painful consequences, painful results, then you should confess it, reveal it, lay it open to the Teacher or to a knowledgeable companion in the holy life. Having confessed it... you should exercise restraint in the future. But if on reflection you know that it did not lead to affliction... it was a skillful bodily action with pleasant consequences, pleasant results, then you should stay mentally refreshed & joyful, training day & night in skillful mental qualities.
We cultivate good the same way we cultivate anything: by giving light and water, and carefully weeding out anything undesired. 'Light' in this sense is conscious attention, which focuses the source of energy for everything we are. 'Water' is compassion (for ourselves and others), that soothes and smooths over every conflict. 'Weeding' means seeing our attachments and delusions for what they are, so we deprive them of the unconscious energy they need to survive.
You don't need to worry about what 'good' is. The seeds of it are already present, and you just need to tend it so it will grow naturally.
Our every action sows the seeds that will become the causes and conditions of future results. An apple seed grows into apple-tree, it doesn't grow into cucumber. Similarly, actions of certain kind grow into results of the same nature, they don't become something completely different.
It is kind of simple. Do not sow seeds of conflict. Be selective about what you consume. Do not feed your ego. Whatever remains - be strong and don't doubt yourself.