A subpoena is actually a court order telling you to appear at a legal proceeding, so you must appear at the place and time designated on the subpoena. Also, if the subpoena requires you to bring certain documents or other objects, you should bring them with you. If you fail to appear as ordered by the subpoena, you may be found in contempt of court and sanctioned with jail time and fines.
It is important to remember that you always, in any proceeding, have the right to refuse to answer questions if your answer might incriminate you in a crime. This is true even if you are testifying in a civil case. If you believe that you will be incriminating yourself by answering a specific question, immediately tell the judge and/or the prosecutor before you answer the question. Otherwise, you may lose your right to refuse to testify.
You also can refuse to testify if answering the question violates a legally-recognized privilege (e.g., doctor-patient, attorney-client, marital).
If none of these legal exceptions apply, then you are required to appear and tell the truth, but you are only required to testify to matters on which you have personal knowledge (unless you are a designated expert witness).
If you have not received a formal subpoena, and you are not a party to the lawsuit, you may refuse to appear at any proceeding. You are also not required to give any information to the police or any attorneys without first receiving a formal subpoena.
If you are not one of the parties in the case, you should be reimbursed for your transportation costs and also receive an attendance fee for your appearance. In a civil case, the person serving the subpoena should give you cash or a check for these costs when you are served with the subpoena. In a criminal case, you will be paid after you travel to the designated place and testify as a witness.
You may try to contact the attorney issuing the subpoena to arrange for an alternate time for you to appear. Otherwise, you should immediately seek the advice of an attorney to see if there are any legal grounds why you may be excused from testifying. There are narrow deadlines for filing a written objection to the subpoena with the court.
If you have been subpoenaed to testify at a legal proceeding, you should contact an experienced criminal defense attorney, especially if you think your testimony may incriminate you. A lawyer can protect your rights and help you file an objection to the subpoena if there are legal grounds for doing so. You should never volunteer to testify without consulting a lawyer.