Energy is a property that matter has. The same amount matter can have different amounts of energy and so represent different states of matter. For example, if you add energy to an ice cube made of water, it becomes liquid water, and if you add even more energy, it becomes steam. The kind of matter is the same, and the amount of matter is the same as in the original cube, but there is more or less energy.
Solid (Ice)
Less Energy
↓
↓
Liquid (Water)
↓
↓
Gas (Steam)
More Energy