When you submit a DNA sample to a company, part of the sample is used when the test is run. How much depends on the test being run. Also, if they need to re-test one or more times, those samples are used up as well.
At some point, all of the original sample may get used up. If the person has died and the company needs a new sample, going to be hard to get.
Some funeral homes offer to collect DNA from the bodies, but it needs to be done fast. I haven’t checked into it, but there’s a charge for the service. Looks like over 3,000 funeral homes in North America offer this service.
Price is dependent on area with a larger population area probably charging more.
A friend’s father-in-law was dying. They estimated 48 hours at best. He called FamilyTree DNA (FTDNA) and asked what to do. They use a cheek swab and recommended buying cheek swab DNA kits from a drug store and mail them to FTDNA. It worked. Friend purchased several of them and sent them all in.