I have line charts which show active, inactive and failed status of an application. Please suggest which are the best colors to depict that.
There isn't a UX answer to this except in the sense of what do your users expect and understand. You need to know your users. In the US red is equated with danger. As a result of it being used in traffic signs it's now associated with stop. Computer interfaces have been using red as failure for a generation now - so that is reasonably understood.
As a result of traffic signs green is associated with go and interfaces have used it for good/active for a generation.
Grey is, in the US (not extrapolating here), associated with inactive in computer apps.
There is no objectively right answer here except in what your users expect and understand.
Example: Red often connotes blood and danger in the West while it connotes good luck, fortune and happiness in Chinese culture. White symbolizes Purity in the West and Death in China. But we can't take these statements too far - you don't see Chinese people forsaking white paper, or white backgrounds on websites, because it symbolizes death.
Don't rely 100% on colour to represent status messages, i would suggest using a label with a background colour to support the nature of the status. Just define your colour pallette and remember to keep it consistent with the rest of the modules in your application; Your users will learn what these colours represent and what to expect from these messages.
It totally depends on your user base. If someone has color blindness then your idea of using color is all wrong. If the chart are for children then some added animation is a good choice along with sharp colors. If they are professionals then use of subtle colors which can be used in a professional world for presentations.