How charities become official

How do you know if a charity is legit?