Civil cases often call for depositions. A deposition is a witness's testimony outside of court, but it is done in the presence of attorneys and a court reporter, so it is considered sworn testimony. In other words, you should treat a depostion as if you are testifying in court. Just as you have the right to refuse to answer questions in court, you may refuse to answer depostion questions -- under certain circumstances.
You may refuse to answer a deposition question because the information is privileged. That means it came from a privilieged communication, which includes any exchange of information between a husband and wife, clergy and communicant, psychotherapist and patient, physician and patient, and attorney and client. Your assertion during a deposition that information is privileged should be supported by referring to one of the privileged communication categories.
During a deposition, you may refuse to answer a question because it is irrelevant to the matter at hand. If you have an attorney, you can temporarily adjourn the deposition while you confer with your attorney on the question being asked. If the opposing attorney insists on an answer to the question, you can adjourn and ask for an order of protection from the court that may exclude the question.
If you perceive that a question is calculated to harass you, then you may refuse to answer. The opposing attorney will either have to rephrase, or make the case that the question seeks relevant information. If you cannot come to an agreement about the intention of the question, you may adjourn the deposition and seek an order of protection from the court to exclude the question.
The Fifth Ammendment
You are not required to incriminate yourself. This protection comes from the Fifth Ammendment to the Constitution of the United States. You cannot use this protection frivilously. You must sincerely believe that answering the question could incriminate you. Using the Fifth Ammendment to simply be stubborn may incur the wrath of the judge in the case and cause sanctions to be made against you, which can include fines or jail time for contempt of court.