First, he refused through words. He explained his belief to her in no uncertain terms. "Look, I will not do this because not only is it disloyal to my master, it is a sin against God," and against her, and it would be a sin against his wife to come.
Second, he bore all the temptations she laid before him, and avoided them as well as he could. When that ceased to be effective and she trapped him, he took physical action and fled. He got out of there no matter what the consequences to himself, leaving his garment behind, which was to them proof that he did what he was accused of. It landed him in prison. But he was able to go with a clear conscience, because he had done what was right. He is a sterling example of crucifying the flesh in order to walk in the Spirit.