Hey TeresaUsa,
It sounds like you need to set up the Continuity features between your devices again: Automatically fill in SMS passcodes on iPhone - Apple Support
Just in case, here's an overview of the various Continuity features with links for the correct settings. This way you can be sure to set up all the features you want: Use Continuity to connect your Mac, iPhone, iPad, and Apple Watch - Apple Support
For this specific setting of autofilling the code, you'll want to set up "Text Message Forwarding", and here's how: Forward SMS/MMS text messages from your iPhone to your Mac or iPad - Apple Support
Set up text message forwarding
Make sure that you're signed in to iMessage with the same Apple ID on each device:
• iPhone or iPad: Check the Apple ID shown in Settings > Messages > Send & Receive.
• Mac: Open Messages, choose Messages > Settings (or Preferences), then click iMessage. Check the Apple ID shown.
On your iPhone, go to Settings > Messages > Text Message Forwarding.* Then choose which devices can send and receive text messages from your iPhone. If you're not using two-factor authentication for your Apple ID, a verification code appears on each of your other devices: enter that code on your iPhone.

As long as your iPhone is turned on and connected to Wi-Fi or a cellular network, new SMS/MMS texts can be sent and received on the devices that you added.
Thanks for participating in Apple Support Communities.
Take care!