Either work. It will depend on the texture you prefer on the outside of your muffin. If you prefer more of a cake and open pore texture on the outside, then use a muffin liner. If you prefer your muffin to have a slightly firm texture with a hint of crispiness on the outside to make it less crumbly and more old-fashioned, then use cooking spray.