I recently done this so here is the process -
you need to save swiftData normally then take the new model struct with the same properties in swiftdata model for firebase ( just difference that in firebase struct you shouldn't make any property var and no init ) then using function sync the data of firebase and swiftdata which you have to keep in async ( the functions) .
Then call those function where you want that this should not be proceeded without syncing the data.
Write the functions for changing , adding new and syncing data for firebase (you'll get this help from gpt or some other stuff)
Then you are good to go .....!!!