Specific heat separates the material property from the mass and the temperature change.
Use mass and specific heat
The sample has mass 2 kilograms. Its specific heat is 5 joules per kilogram per kelvin.
m=2 kgc=5 J/(kg K)
Specific heat scales by mass
Specific heat is per kilogram, so multiply by the mass and by the temperature change.
Q=mcΔT
Compute the heat
Multiply 2 kilograms by 5 joules per kilogram per kelvin by 3 kelvin. The result is 30 joules.
Q=2 kg⋅5 J/(kg K)⋅3 K=30 J