I change my passwords at least once a year. This is a personal security precaution that sometimes has unforeseen consequences.
For example, after changing my Apple account password, the SMS forwarding feature from my iPhone to other devices like my Macs got disabled.
When I reactivated the feature, I should have been prompted to enter a four-digit code generated on the target device into the iPhone. However, the code did not appear.
Here is a workaround. To enable text message forwarding and get four-digit confirmation codes after changing my Apple password:
1. Disable and then reenable iMessage on the iPhone (Settings -> Messages).
2. Ensure you are logged in to iCloud on the iPhone and target devices.
3. Enable forwarding on the iPhone to other devices (Settings -> Messages -> Text Message Forwarding). Do this one at a time, that is, enable the device, get the code, enter the code. Then repeat for other devices.
Other information I found online was a start but inadequate. So I am adding more currency to the pool of information.