I'll usually just ask to work in or go do something else if that's not convenient.
I train early in the morning so I rarely have any issues.
If people try to "hold" equipment by leaving a towel or water bottle on it while they go do something else I'll throw it on the floor and use the equipment anyway if I need to.
There was only one time in all my years of lifting I told a couple guys off for hogging equipment that they weren't using. It was more than 20 years ago, and I always did legs every Saturday morning. Squats, then leg press, then hams and calves. So I get there and two guys at using the only leg press machine we had, but they're doing more talking than lifting. They did a single set each while I did my squats. I asked them how many sets they had, and they were vague "A few" or something like that.
So I went and did hamstring curls and the entire time neither one of them did a set; they just stood there yapping.
So I went over again and asked if I could use the leg press and they said they were still using it. I snapped a bolt and said something along the lines of "Neither one of you has done a set in over 20 minutes, so why don't you two ladies move your tea party to the coffee shop down the street and let people that want to train use the equipment?"
They cried to the manager about me.