Basis of Retirement Income

For example I took out 5000 from my 401k early but have never made contributions to the plan myself. (It is 98% profit sharing and 2% rollover from another retirement amount from the company) Just trying to figure out basis based off of that