Most employers do not dismiss any of their employees without good reason, but from time to time it becomes inevitable. The most important document from a legal point of view given to an employee who is to be dismissed is a dismissal letter.
Long gone are the days when you started work with a company or government department when young and worked with the same employer until you retired. Most people expect to change their job, sometimes their whole career, several times in a working lifetime.