In today's digital era, operating systems play a crucial role in various technological devices. This paper discusses the optimization and modification of Debian, one of the most stable Linux distributions, to enhance its performance as a real-time operating system (RTOS). The primary objectives of this research are to improve the responsiveness, reliability, and stability of Debian in handling real-time tasks. The study involves modifying the kernel, adjusting scheduling settings, optimizing memory management, and integrating specific real-time software. The results of the tests show that the modified Debian provides lower and more stable task execution latency compared to the standard Debian. Tests were conducted using the cyclictest software to measure system latency and Htop to monitor CPU and memory performance. Additionally, the use of the VLC application as a real-world workload demonstrated that the optimized operating system could handle task priorities more efficiently, allocate resources as needed for real-time demands, and maintain stability under heavy workloads. This research significantly contributes to the development of Debian-based RTOS, which can be applied in fields such as industrial automation, robotics, and IoT devices. The optimizations ensure that the operating system can meet the high-performance and real-time reliability demands of these critical applications.