You have a couple of options. First is to purchase a cable directly from Apple knowing it will work for sure and is of high quality. Second is to look for the MFI (Made for iPhone) seal on the package of any third party cable you consider. The MFI seal means that the maker of the cable is licensed and approved by Apple to sell products as iPhone compatible. The MFI seal also means the cable meets or exceeds Apple’s standards. If a third party cable does not have the MFI seal DO NOT BUY IT under any circumstances. It may damage your iPhone. There are thousands upon thousands of ripoff cables out there that you find in gas stations, liquor/convenience stores, discount outlets, etc. Avoid them like the plague.