randomly complimenting people is great. what did it cost u? nothing. and u probably made their day.
general tip to avoid coming across as a creep instead of a positive nice person: compliment them on something that was their choice.
don’t compliment them on things they didn’t have any power over, like having pretty eyes or being tall or being from new york or whatever. compliment them on stuff like their outfit, their parallel parking skill, their smile, or a clever turn of phrase.
the one exception: you can ALWAYS compliment them on how cute their dog is. they didn’t make the dog cute but no one cares. everyone loves it when you admire their dog.