These are just two different types of unit within a firm. A cost center is one that costs more money to the firm than it brings in. A profit center is the opposite.
A cost center is some part of a firm that does not make money in any immediate way for the firm. The most typical kind of a cost center for a company would be a research and development department. Such units can cost the firm a lot of money without immediate benefits. Managers in such centers are not tasked with trying to do anything other than staying within their budget while fulfilling their mission.
On the other hand, there are parts of firms that make more money than they cost. These are the ones that make it possible for the firms to afford to maintain the cost centers. The goal of the profit center is to do things like increasing sales so as to increase revenues. At the same time, they need to cut costs as much as possible to increase profit further.