There’s a type of aid item simply referred to as “ship parts.” Places like Jemison Mercantile and UC Distribution Center sell them sometimes, and you may even earn them by helping UC/Freestar ships beat up hostiles in random encounters.
Edit: and don’t keep them in your on-foot inventory, they weigh 10 kilos each.
Each ship has a cargo hold that you can dump stuff in. From the 2 ships I've been in (Frontier and Shieldbreaker) you can access the cargo hold from a computer to the left of the pilot seat. If you buy or find Ship Parts (the name of the item), you'd have to go to your characters Aid section, and move them to your ship's cargo hold. Then the button shouldn't be greyed out anymore.
Ship parts are an item like med kits, but for ships. You can buy them from some merchants or sometimes loot them from destroyed ships.If it's in the cargo hold of your ship you can use them. You can enter the ship's hold a number of ways. In the start menu go to ship and you see a button to enter the cargo hold on the bottom right. There you can store or take items from your cargo hold like you're trading with a companion, as long as you're in a radius of 250 meters of your ship. There's also a blueish computer screen in your ship's cockpit where you can enter the cargo hold, in the frontier it's on the left on the wall just before your piloting seat.
Since nobody else has said it, 'ship parts' is the item name, not referring to any specific parts. It's a general resource for on-the-fly ship repairs.
Go to your cockpit. There should be a cargo hold panel there. Buy the ship parts from vendors and put them into your cargo hold via the panel in your cockpit. Then once you've lost hull press O on your keyboard(iunno controller equivalent).
It took me so long to figure out that I needed ship parts for repairing! I was hoping for a message when trying. If there was a message, I didn't see it.
Do you have Ship Parts in your cargo hold? Pushing 0 should let you repair. Also a Ship Services Technician will gladly take 1000 credits to repair as well