Cables that adhere to the USB spec are required to indicate the USB version and data rate the cable was tested to meet. USB 1.1 and 2.0 cables will have the original USB "trident" icon. USB 3.x cables will have the trident with the additional stylized "SS" on the trident and often a small number 5, 10, or 20. The number indicates tested bandwidth in Gbps, and having no number means it was tested at 5 Gbps.
Newer USB4 cables will have a large 20 or 40 with the trident instead of the SS, but I have not seen this yet on any products. Examples of these icons, old and new, can be seen on the USB4 Wikipedia page: https://en.wikipedia.org/wiki/USB4#Data_transfer_modes
There are cables that will work for USB but lack the USB markings. These will be cheap imitations and since they don't adhere to the specified marking standard there's no telling what the cable is capable of doing without testing it. Testing these unmarked cables by plugging them into a computer can do damage so buyer beware.
There's other answers that will point out that there are cheap imitations that have the USB trademarked icons but these are quite rare. To get one of these would mean someone is really digging for a bargain or got very unlucky with an imitation making it to a reputable retailer. Making cheap cables is not illegal so there are plenty of those. Making cheap cables and putting trademarked icons on them without permission is illegal so they tend to disappear shortly after they appear.
Getting a bit off topic is the matter of Thunderbolt cables. Thunderbolt 3 and Thunderbolt 4 use the USB-C connector but will not always have the USB markings on the cables and ports. Thunderbolt 3 and 4 is a superset of the USB specification and so USB-C cables with the Thunderbolt markings will work with USB devices. Like with USB there's often a small number next to the icon, this does not indicate speed but version. I don't know if there's any real change made to the cable spec from 3 to 4 but those tested to the Thunderbolt 4 spec will have a small number 4. Some cables with USB-C connectors not marked with the Thunderbolt icon will work as a Thunderbolt cable. Some USB-C cables marked with Thunderbolt icons were tested to work with USB at all speeds, exceptions will be cables over one meter long that are optical cables or with signal amplifiers.
The color of the plastic in the connectors to indicate the kind of cable is either optional by the spec or was thought up by someone outside of the USB spec authors, it cannot be relied upon to indicate the cable capability.
So, look for the USB icons on the cable connectors to see if they've been tested to meet the USB spec. It's possible, but unlikely, someone put that icon on there without permission and it's a cheap imitation. No icons doesn't mean it's junk, though that's the safe bet, it means it was not tested for adhering to the spec. Most Thunderbolt cables will work as USB cables while few USB cables also work as Thunderbolt cables.