Unless there is a compelling reason to believe that they will not attend, witnesses are usually asked to agree verbally that they will turn up in court as requested.
If you do not do so the prosecution or defence (whichever of them is using you) can ask the magistrates or judge to issue a witness summons. If you do not respond to this you can be arrested and brought to court.
This action is not often taken, and if so it is as a last resort. What you have to remember, of course, is that a reluctant witness is often less use than no witness at all. Whilst you may be forced to attend court, you cannot be forced to accurately recall the events in question and many witnesses who are so summonsed suffer alarming degrees of amnesia!