it means dont judge a person on how they look and only judge them on who they really are!
If you judge a book by it's cover is to judge someone or something before you get to know them or try it. Such as if someone looks funny and you don't know them you shouldn't make fun of them because they could turn out to be the nicest person you ever met. Also if someone advertises for a product and you don't think it will work you shouldn't because it might work really good and it will be fun and/or good for you to have. On the other hand something could look good and be really bad. So if someone is really pretty that doesn't mean 'Oh, that person is really pretty they must be nice!' They could be really stuck up and mean. Or if something looks shiny and new and people on TV. say it works really good it could be bad.
The meaning of the saying 'never judge a book by its cover' is that we can't simply judge people only by their appearances.
But, this is not always true. For instance, if an employer wants to recruit an employee and hundreds of people apply, the employer will probably narrow the list down based on first impressions. In other words, the employer is judging them by their 'cover' to save time.
But when it comes to choosing friends, we have to choose carefully. Some people might be bad for us. If we choose them wrongly, the consequences are very serious - the wrong kinds of friends can create all kinds of trouble for us.
I think, rather than judging a book by its cover, we need to read the content of the book