Replace it.
That happened to me once. Slide takedown thing spring broke on my G23 gen 4 at roughly 6K round mark. Happened towards the end of the day at a Gunsite class. Finished the class that day with my G26.
The Gunsite Smithy didn’t have the part and told me he’d never seen that spring break, so I went to a LGS for help. They called some guy they knew who was in transit moving between CA and AZ and in the area. Met the young dude in a fast food parking lot 30 minutes later, his young wife and toddler were in the truck with him. It was around 7:00 PM. He pulled out a parts kit (tackle box), slapped the part into my gun, and performed a function check. Good as new in 2 minutes. Still in my gun today, at around 20K rounds.
I asked him what I owed him, and he said “$1.50”. I handed him $40 and told him to enjoy his evening. He said it was too much, and I told him he just saved a $3K gun vacation. I handed him another $20 and told him to grab a bite with his family and enjoy his night. I truly hope he is doing well today. Good guy!
Long story, but thought I’d share it. Never had it happen since on any other gun, but I ordered a couple more when I got home for my “Glock kit”. About 6 years and they are still in that parts box...
Best thing is the pieces cost next to nothing, like most Glock OEM parts...and last pretty much forever.