It depends. If you have stock, you must figure out the what you paid for the stock. If dividends were reinvested and used to purchase more stock over time, then you would include all reinvested dividends as part of your cost. If you didn't sell all of the stock, and you didn't specify which shares to sell (uncommon), you will use the First In First Out (FIFO) method.
You can use internet sites to find the value on certain dates which could also help you. Simply search for 'historical stock prices'.
Although finance companies are now required to maintain the cost basis, it wasn't always that way. Also, if the stock was moved from one company to another, there would be no way for the second company to know your stock basis.
**Say "Thanks" by clicking the thumb icon in a post**Mark the post that answers your question by clicking on "Mark as Best Answer"