Wellbore stability analysis is a critical component of petroleum engineering, evaluating the risks of sanding, reservoir compaction, and casing failures. Laboratory rock mechanical measurements must be scaled up to reservoir scales to achieve accurate results. One challenge lies in upscaling dynamic measurements from petrophysical logs to pseudo-static elastic properties, which has significant implications for oil and gas operations. We present a novel approach that combines laboratory rock mechanical measurements with well-log data to develop a mechanical earth model (MEM) for an Iranian oilfield with over 350 wells. We conducted static elastic property measurements on 40 core samples from various layers and depths of carbonate and sandstone rocks, demonstrating the practical application of our approach. By integrating these measurements with dynamic log data and static-dynamic correlations, we established a framework for evaluating the mechanical properties of different layers. Our findings indicate that the safe mud weight window ranges from 41.5 to 118.59 pcf, while the stable mud weight window ranges from 41.5 to 156 pcf. We demonstrate the importance of conducting parallel rock mechanical studies on cores and logs to reduce uncertainties, costs, and risks during oil and gas operations. We also propose a novel methodology combining lithological characteristics, abnormally high pressure, and borehole instability mechanisms to evaluate the stability of borehole walls. This framework provides a fresh perspective on wellbore stability analysis and offers practical solutions for the industry. Essential novel techniques include developing a geomechanical model that integrates laboratory rock mechanical measurements with well-log data to evaluate mechanical properties and calculate safe and stable mud-weight windows. Our study advances wellbore stability analysis by providing a new method for addressing this long-standing challenge. It offers valuable insights for petroleum engineers working in the oil and gas industry.