Here are some suggestions to add to what others have said above;
Use ProRes Codec. Think about using separate drives for a) store footage on one drive, b) set cache/render settings on a separate drive. Buy faster hard drives (7200rpm minimum). Look into RAIDing two drives together for speed if needed.
If all else fails, get a better computer; processing speed and memory of MacPro > iMac or Macbook pro. (**astericks on the MacPro vs iMac, considering Apple hasn’t updated their pro line in years and MacPro is still buzzing on SATA II when the new iMacs got SATA III capability, lol.)