3 Do not be in a hurry to leave the king’s presence. Do not stand up for a bad cause, for he will do whatever he pleases.

Read Ecclesiastes 8:3 Using Other Translations

Be not hasty to go out of his sight: stand not in an evil thing; for he doeth whatsoever pleaseth him.
Be not hasty to go from his presence. Do not take your stand in an evil cause, for he does whatever he pleases.
Don’t try to avoid doing your duty, and don’t stand with those who plot evil, for the king can do whatever he wants.