Have you tried rebooting the laptop?
Did you approve the connection for the external device you are connecting? macOS will pop up a window asking you to approve or deny the device connection. Sometimes this pop up window will be hidden behind other windows or may not even appear on screen. For that reason I prefer to configure my Privacy & Security System Settings for "Allow accessories to connect" to "Always when unlocked".
If your Mac asks you to allow an accessory to connect - Apple Support
Are you connecting the device directly to the laptop or are you using an adapter, dock, or hub?
What type of devices are you trying to connect?
Have you checked the Apple System Profiler (aka System Information) to see if the physical device is detected under USB or Thunderbolt?
Try running the Apple Diagnostics to see if any hardware issues are detected. I doubt it will detect a USB/Thunderbolt port issue. Diagnostics are only useful when a problem is detected.
Apple has a 14 day return window if purchased from Apple, but I don't know if it allows for a faulty device.
The device has a one year warranty unless AppleCare+ was purchased to extend it or to cover accidental damage.