Retirement tax questions

When a distribution from a Roth occurs, your  contributions come into play.

See Form 8606.