Traditional IRA, Taxable IRA, ROTH IRA and 401k distributions

i have all the above retirement accounts.   even the 401k has some funds already taxed.   When i take a retirement distribution - can i selectively withdraw from 1 specific account ?- The ROTH is tax free, the Traditional IRA will be fully taxed, the Taxable IRA is only taxed on the gains and the 401k has some cost basis as i added some post tax distributions.   how do have to make withdrawals.?   I heard i have to consider all the IRAs together and withdraw proportionally pre-tax as capital gains, and after tax is not taxed -  then adjust my new cost basis.   does anyone have some instructions on this ?..  how does this effect 401k distributions - are they considered separately?   thx