If you don't know what has stung you, ask lifeguards or local people what is native to the area and treat your sting accordingly.
Sea urchin spines can penetrate sandals and flippers. If one breaks your skin, it will probably cause redness, swelling and burning pain. Pull out any visible spines with tweezers. Wash with soap and water, then apply a hot-water compress and an antiseptic ointment or warm olive oil. If you feel intense pain, see a doctor.