These are like a trial, but less formal. They do, however, require extensive preparations, as they are considered part of the pre-trial discovery process. All the key people involved will need to be present at the court. The attorneys will ask questions of either side to get their versions of what happened. Any statements made at the deposition can be used at the trial. Remember that you are under oath, so you cannot lie in court.
The purpose of the depositions is to ensure there are no surprises when it comes time to take the case to trial. If a statement made at the deposition does not match the statement made in court, the person is lying and can be charged with perjury. Perjury is a serious crime that can result in imprisonment.