"How to know If something is good or evil?"
I maintain that good/evil/morally wrong/etc are notions that are dependent on a specific, subjective moral code. So in order to answer your question, you first need to establish the code, then you'd analyze the action/thing, and based on the premises that you laid out (if thoughtful and complete), you'd come to a conclusion.
So now the difficult part is to establish a code that is complete and covers all scenarios, or that if it doesn't, reserves "grey-areas" as uncertain or as too pedantic to analyze.
However, a lot of times we assign the values of good/evil to practically unquantifiable criteria, and so as very difficult or impossible to determine.
For example, I can say that an action is evil if someone was being malicious or even negligent to a certain degree; this degree is basically them feeling in certain way, with intent or laziness, to cause an amount of harm, or that could create it. But this feeling is basically qualia, I cannot measure that reliably. Would it be evil if a teenager planned to paint a public wall? Or what about pirating some lesser known artist's work? What about someone neglecting something that causes an accident? What if they were not entirely (but to some level) in their proper mental faculties? What level of negligence do I reserve for something to be evil?
Some examples, but only to highlight that it's not black or white, there is a gradient, the gradient of morally wrong or not, and you are the one who paints that spectrum, which under it, should give you the answer. If there are no blanks in it and you are thoughtful, most of the time you'll be able to tell "right" from "wrong", but of course, your right or wrong.