Mediation or arbitration are often suggested or required before a trial is scheduled as a way to resolve problems peacefully and agreeably. If a trial is held, both the landlord and the tenant can have attorneys handle their cases, though in housing court many landlords and tenants represent themselves. Housing court isn't as formal as other courts, and the judges are used to people representing themselves. Both sides are given a chance to tell their side of the story and to present evidence. If the judge agrees that the tenant should be evicted, the court will issue an order stating the tenant has to move out by a particular date.
Courts can also order tenants to pay back rent and to pay for damages to the property.
Tenants are usually given at least 24 hours to move. If the tenant doesn't comply with the court's eviction notice, a marshal or sheriff will do the actual physical removal. Landlords should never attempt to evict tenants themselves, nor should landlords remove the tenant's belongings. Work with an experienced lawyer in your state.