I am assuming you are referring to Remodel. When you trash a card with Remodel, you look at the price of the trashed card and then gain another card costing up to two more. Card types are completely ignored for this. You can, for example, trash a Gold which costs 6 $ to gain a Province costing 8 $. Just as well you can trash any card costing 4 $ to gain a Gold. Also the card you gain has to cost "up to two" more, which means that you can also choose to gain a card that costs only one more, the same, or even less than the trashed card. You can even chose to gain another copy of the card you trashed. What you can not do is refuse to gain a card. If there is at least one card in the supply that costs up to two more than the trashed card, you have to gain one of them.
Edit: To clarify this last point, the reason why you can not refuse to gain a card is that when you play a card, you have to follow its instructions and do everything that you can. So if you play Remodel, you have to do all it says. If you don't want to do something a card says, you can refrain from playing it at all. If you can't do something a card says, you can still play the card, but leave out the parts you can't do. So if you played Remodel without another card to trash in hand, you would neither trash nor gain one. And if played Remodel to trash a card with no card in the supply costing up to two more, you would have to leave out the gaining part alone. Mind you, this will not happen under normal circumstances, as three cards costing 2 $ or less are part of every game: Copper, Curse and Estate.