Proverbs 23:9 Do not speak in the hearing of a fool, for he will despise the good sense of your words.
Sometimes the best advice is no advice. Even though you mean well, a fool will not listen to wise counsel. In fact, he will “despise the good sense of your words”. So what do you do? The key is to now your audience. People with a long history of rejecting wisdom tend to continue. Save your words.
Don’t judge wisdom based on how it’s received. If you get rejected, don’t go around trying to figure out a better way to reach a foolish person. The advice you gave was good. The problem lies with the person. If you are on a mission to spread good sense, you can expect most people to ignore you. That’s okay. Just find different people.