It all depends on from which country you are from. From seeing the wiring color code, I assume that you are probably from an asian country or a country that follows IEC 60446 standards.
As you have red colour wire, it must be the phase. Green wire should also have a yellow stripe on it. So it must be ground or earth. So the third one ie: black color wire should be the neutral.