Going to court as a victim or witness

What happens at a criminal, civil or Children's Hearing court case. Giving evidence and claiming witness expenses at court.