Whitewavemark2
I have hat pins 😊 different colours. They work quite well. I don’t wear hats much these days, but always a sun hat.
Hat pins only work if your hair is long enough to be gathered in a bun as the pin goes through the hat and into your hair.
Since I cut my long hair, I have the same problem as OP, but I did manage to find a straw hat last summer that had a tape threaded through the lower edge of the crown so it could be tightened to fit.
I don't know if other types of hat have this kind of tape, or if it is possible to insert one in a hat, but I find it very useful.