currentID only exist in the if and the else, outside that its not declared, you can declare it before the IF and initialize inside the IF and Else.
Also as commented if select its not 1 or 2 it would not be initialized and can cause problems so make sure to initialize it.
void IDcard::Prepare(CoatingDecorator *coating)
{
IDcard *currentID;
if (select == 1) { currentID = new Passport(); }
else if (select == 2) { currentID = new DriversLicence(); }
AddPhoto();
coating->Prepare(currentID);
std::cout << "Total Cost: " << coating->totalCost;
DispenseID();
}