Pull them is the best.
Those are evil! Pull with a pair of gloves ensuring you got the root. RoundUp if you need to.
There is no easy way to get rid of goatheads (Tribulus terrestris). https://www.opsu.edu/Academics/SciMathNurs/NaturalScience/PlantsInsectsOfGoodwell/plants/pasturebig/goatheadffa6_10_33.jpg While herbicides will kill the plant, mature seed in the soil will still germinate. If you use an herbicide it should be applied before or as the plants begin blooming. Remember that herbicides will kill every plant including grass you want to keep. That's why people are telling you to pull up the individual plants, roots and all. Make a habit of looking for the plant whenever you are outside and pull up any as you see them.
Another plant sandburs, aka grassburs or sandspurs, (Cenchrus ssp.) also have sharp thorny seeds. These are part of the grass family. https://www.weedalert.com/images/weed-images/s/Sandbur1.jpg The seeds begin germinating from late spring all the way into fall. Use a pre-emergent herbicide to cut back on germination; however, removing the plant as you find it is the best way to eradicate it. When this one is mowed, new growth is sideways and the flower heads will not get cut with the next mowing.
Elbow grease is your best bet. Pull them up as often as you see them
Spray emergent goathead with a post-emergent herbicide containing the active ingredient glyphosate. Glyphosate will kill or severely injure any plants, so use it carefully around landscape plants. Since glyphosate is so effective at killing plants, it should only be used as a spot treatment.