How can I repair a rotted door threshold?
To do it properly you're going to have to pull up that aluminum door sill to see what's going on underneath. It appears that water has been seeping under the door sill from the outside and has rotted part or all of the underlying door frame. It's also possible that the water is coming in along the perimeter jambs and seeping down to the sill. To remove the aluminum sill you're probably going to have to remove the door stop trim on either side of your door. If you do it carefully you can probably re-use it.
The sill may be glued or screwed on. This will expose the wood sill frame underneath. The wood sill will be attached to the jamb on both sides. It may all be rotted or just part.
To replace it you'll have to cut it out at the jamb on both sides or if it's only rotted along one length you might be able to remove the compromised part with a chisel. Let the area dry out removing any rotted portions. You can then replace/repair the wood sill with new wood by attaching it directly to the framing underneath as a support for the aluminum sill.
You can then reinstall the aluminum sill and the adjustable threshold that came up - you probably will want to replace it with a new one. it's critical that you weatherproof around the aluminum sill with exterior silicone caulk. You also should caulk the entire exterior perimeter of the door and it's trim and make sure the weatherstripping around the door, especially at the bottom isn't leaking. Until you weatherproof it the problem will only recur and get progressively worse.