This paper aims to provide an introduction to the analytical modelling and the discrete-events simulation for a manufacturing system. A general method of constructing a Markov chain and the simulation with discrete events using Delmia Quest software, are presented. In the present paper, those interested can find a real case study: modelling and simulation of the headrest support manufacturing line. The scientific contribution of this paper consists in the development of a theoretical model implemented in a real case study. The theoretical model estimates the production rate of the line and then, using this model we can establish how many parts in the buffers are required in order to achieve a production rate of X parts per minute. In the first phase, the manufacturing line is analysed, then the Markov chains for subsystems with two machines and a buffer are constructed. As the Markov chains need more time to provide solutions in queues theory, they can be used only for small production lines. To find the production rate for all the system, it is necessary to apply the Markov chains and the decomposition method. Those methods are implemented in the C/C++ programming. To validate the analytical model, the discrete-event simulation with Delmia Quest software is used. The article presents some comparisons between modelling with Markov chains and simulation with Delmia Quest software and provides a method of optimization of the buffers for the case study.