Sex after c section?

How long did you wait to have sex after. A C section? What are some safe tips?? Did it hurt