How to prevent the updating of specific user fields

Thank you for your answers, will get it working with that. And I agree that it’s overkill to block to such an extent, but that’s the assignment.