Open the Samsung Members app. Tap Support > Phone diagnostics. Select USB connection or Battery status. This will tell you if the phone actually sees the cable.
Go to Settings > Battery (or Device Care). Tap on Charging settings. Toggle off Fast charging. Plug it in and see if it recognizes the charger. If it does, you can try toggling it back on later.