Select all the faces with inverted normals
If you select all and merge vertices by distance (alt + m) to avoid separate faces, you can then use Recalculate Normals function (shift + n outside, or shift + ctrl + n inside). If that does not work, it means there is simply no way for the algorithms to determine what the right direction might be - if for example you had a few separate planes in random orientations in the mesh of the object, there would be no way to determine what you want to consider the right direction for normals or even what would be consistent for all of the separate planes for your situation without you specifying that. In that case you need to manually select them and set the normals as you like.