Deductions & credits

How would you calculate the cost basis in dollars e.g should i be considering the dollar rate at the time of purchase? Where can find dollar rate for older years