If you still have one of the two that came with the car, this is as simple as removing the lost one from the car, and purchasing a blank one from tesla, then using the one you still have to add the blank one to the car.
A keycard is $35 in the US, but you would want to order it from the tesla store for your country.
Model S, Model 3, Model X, and Model Y vehicles come with two Key Cards and one bifold wallet for easy entry, operation and transport. Key Cards are convenient for when your phone is not accessible, out of battery or if someone else needs temporary access, such as a valet. Includes: 2x key...
If you DONT have ANY keycard at all for a model 3 or Y (you lost BOTH of the ones that came with the car), then you would need to get tesla to sell you a new one programed to the car, after proving ownership.