To sell cargo, you must transfer it to a faction trading structure that supports trading of that cargo.
A Bazaar can sell consumables.
A Merchant Station or Base can sell books, commodities, legal equipment ports and legal weapon ports.
A Junkyard can sell equipment parts, ship parts, structure components and weapon parts.
An Asteroid Bar can sell illegal equipment ports and illegal weapon ports.
Using a shipwright you can list ships your faction has crafted for sale.
It is worth noting that the trading role ships can also sell ports and fuel.