If you’re not an Artificer (or friends with one), you’re going to have to work with your DM or take a week off from adventuring.
The magic item we’re after is Prosthetic Limb:
This artificial limb replaces a hand, arm, foot, leg, or similar appendage that was lost or removed. While the prosthetic is attached and attuned to you, it functions identically to the body part it is replacing. You can detach or reattach it as an action, and it can’t be removed by anyone else.
If you have multiple prosthetic limbs, they count as a single magic item with regard to the number of magic items you can attune to.
The item already exists (in the Eberron setting) and works exactly like you want it to, it’s up to the DM to work it into the setting.
If there is concern that Eberron is too technological, this item was also printed in the exceedingly fantastical Explorer’s Guide to Wildemount.
Now, if you literally want to make one as a player, your best bet is to have two levels of Artificer and use Replicate Magic Item:
Using this infusion, you replicate a particular magic item. You can learn this infusion multiple times; each time you do so, choose a magic item that you can make with it, picking from the Replicable Items tables below.
Notably, the prosthetic limb appears on mentioned table. If this isn’t an option, work with your DM. A good DM likely would have no problem permitting this magic item as a means character development. I know many DMs who would envy a player taking such an interest in giving their character a prosthesis.
Additionally, Xanathar’s Guide to Everything has some optional downtime rules for creating magic items, summarized here:
Crafting Magic Items. Creating a magic item requires more than just time, effort, and materials. It is a long-term process that involves one or more adventures to track down rare materials and the lore needed to create the item.
Following Xanathar here, it should take about a week to spend the time creating the prosthesis, since it is a common magic item. Notably, these rules recommend involving a side quest prior to spending the downtime to create the item, so again, you will have to work with your DM.
As of a November 10, 2020 errata, prosthetic limb no longer appears on the replicate magic item table, but is still eligible for Replicate Magic Item. See this errata document for Eberron: Rising from the Last War:
Alternatively, you can
choose the magic item from among the common magic items in
the game, not including potions or scrolls.