There are three stages involved in UPSC IES/ESE Exam;
Preliminary is held in offline in MCQs format, it consists of two paper, first is General Studies and Engineering Aptitude for 200 marks conducted for two hours which is a common paper for engineering graduates, and second one is of 300 marks conducted for three hours, it's related to your field which is mechanical engineering in your case. There's negative marking scheme, one-third marks is deducted for each incorrect attempt.
Mains too consists of two papers, each is of 300 marks, and conducted for a duration of three hours, and both are related to your field, that is mechanical engineering.
Personality Test is the last stage which is of 200 marks.
Coming to the syllabus part, Paper I consists of Fluid Mechanics, Thermodynamics and Heat Transfer, IC Engines, Refrigeration and Air Conditioning, Turbo Machinery, Power Plant Engineering, Renewable Source of Energy, and Paper II consists of Engineering Mechanics, Engineering Materials, Mechanisms and Machines, Design of Machine Elements, Manufacturing, Industrial and Maintenance Engineering, Mechatronics and Robotics.
For more details regarding this, visit the official notification of this year at https://upsc.gov.in/sites/default/files/Notice-ESEP-2020-Engl_0.pdf
You can get this year question paper for General Studies and Engineering Aptitude at https://upsc.gov.in/sites/default/files/QP-ESEP-20-GEN_STD-ENGG_APTT.pdf
And for paper of Mechanical Engineering, check out; https://upsc.gov.in/sites/default/files/QP-ESEP-20-MECH_ENGG.pdf