Hand-stitch it back in place.
Sew it. Takes five minutes, costs nothing, and holds up way better than a safety pin or knot.
Swimsuit straps usually come loose at the attachment point (where the strap meets the ring or slider) because the elastic has stretched or the factory stitch popped. The fix is simple: thread a needle with polyester thread (nylon or cotton will rot in chlorine), tie a knot, and sew four or five tight stitches through the strap and the fabric loop. Double back for strength. Done.
If the strap itself is too long, don’t cut it. Just overlap the strap an inch where it attaches and sew through the overlap. No special skills needed.
A safety pin or knot will work in a pinch, but it’ll look sloppy and might poke you. Sewing is the cheap, permanent fix you do once and forget about.
Future you at the beach will thank you.
