This is huge and complex question ask.
When you do not know how to do something, split it into smaller tasks, write down those tasks. Then repeat until you have so small tasks you know how they can be done.
For eg. buying ship:
- you need shop, player, and ship. So you kind of have 3 smaller tasks right there.
- for shop you need umg interface, currency (player stat), some NPC seller (bot), and inventory with ships.
And you keep splitting that big problem into smallest possible tasks. Then start coding them one by one. I doubt anybody will write you sterp by step instructions how to code it all.
Also start doing tutorials, while learning you will get idea how to code and what small tasks you need for your game.