This is why I only ever use my credit card for any purchases (paid off monthly) and only use my debit card for ATM withdrawals. My bank doesn't let me lock the card in the phone sadly.
Another useful tidbit, if you have an iPhone, get the new Apple Card credit card (really goldman sachs). The physical card does not have the number printed on it anywhere. You can only see the last four digits of it in the app. They give you a totally different number, that you can access in the app, to use for online purchases or any transaction where the card isn't physically used. If the online number is compromised, you can immediately deactivate it and get a brand new one in the app without losing use of the physical card and having to wait for a new one. If the card is compromised, the reverse is true. You don't lose access to the other number (though you'd still replace it in that case) for online and manually entered transactions. Every card should work this way.