What do you value?
Proverbs 23 is about values, particularly material ones. The warning is to be careful what you value, what you long for, and whose company you keep.
I take verses 1-3 two ways. On the one hand, don’t long for the stuff of the wealthy. Their stuff is deceptive. It will not bring happiness and has likely brought them sorrow (vss. 1-3). On the other, when in the company of the wealthy, don’t take advantage. To this day, when someone else is buying my dinner, I only eat what I can personally afford.
Don’t work your self to death to accumulate wealth. In a moment, illness or an economic downturn can take it all from you (verses 4-5). Then what will you have?
And then, there is the illusion of happiness that comes from too much materialism. Those who give themselves to satisfying every desire will find themselves either unable to afford the necessities (vss. 19-21) or drowning in their luxuries (vss. 29-35). In the end, keep a level head, and balance in all things.