It’s a frustrating experience when you plug in your iPhone and nothing happens. Eventually, you may get the phone to draw power by wiggling the cable in the charger port, or by sitting it upright—only for the problem to return next time you go to charge the iPhone.
This has happened to me on a series of occasions, causing me concern the phone was defective. But each time I brought the phone into the Apple store, I discovered the problem was a one simple one: Lint and other debris had clogged up the port, making it hard for the cable to make a connection.
While an Apple store employee will helpfully solve the problem with a custom tool, I’ve discovered you can do the same thing on your own with a paper clip. In the last year, I’ve done this twice successfully—once to clear out the charging port, and the other time to clear out debris from the headphone jack (I had initially thought the threading for the headphones was worn down—turns out it was just clogged up).
Get Data Sheet, Fortune’s technology newsletter.
While this is a handy trick and can save you a trip to the store, some may worry about damaging the phone or voiding Apple’s warranty (the company is not a fan of DIY solutions).
Apple did not respond to a formal request for comment, but one of their story employees told me in confidence that the paper clip trick is probably okay so long as you’re careful.
This jibes with what Fortune‘s resident Apple expert, Don Reisinger, had to say. He told me a paper clip is probably safe provided you’re gentle, and also passed on some other tips:
So there you have it: The next time you worry that your iPhone’s charging mechanism is broken, you can try cleaning it yourself—just be sure to use a light touch.