If you want to sync standard common attributes from active directory to sharepoint. Its easy, AD sync to Azure AD and your standard attributes sync automatically. But if you want to use extended attributes that’s a whole different story. What I found is that even though you can sync the extended attributes from AD to Azure AD, they won’t sync to sharepoint. You have to use something else to directly push the attributes into sharepoint. Below are some links to set that up and document what will and will not sync from Azure AD.
About user profile synchronization – SharePoint in Microsoft 365 | Microsoft Learn
Bulk update custom user profile properties for SharePoint Online | Microsoft Learn