Here, I draw the free body diagram of an example with two masses, a cable, and a pulley, to find an equation for the acceleration of the entire system.
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.