Your statement needs clarification. If the retirement account was a tax deferred account and all the contributions were pre-tax, then the entire amount of the distribution is taxable not just the capital gains. You should receive a 1099-R at tax time and you enter it on your tax return. Financial institutions are generally required to withhold 20% federal taxes on a tax deferred account distribution.