To ask your friend how they are doing after their surgery in Spanish, you can say:
¿Cómo estás? (informal)
If you are speaking to someone older or want to be more formal, you can use:
¿Cómo está usted? (formal)
Both are appropriate, but the choice depends on your relationship with the person.