Bags are manufactured with many different materials, and in some cases, multiple layers of material like a paper or foil bag lined with poly. Depending upon the type of bag, you might need an Impulse or Constant Heat Sealer.
Impulse sealers will apply a timed about of heat and then shut off for the seal to congeal. Constant heat keeps heat applied to the bag until you remove the bag from the sealer.
For heat sealers to work the bag must have some sort of poly interior otherwise you will need to consider using a tape or wire twist tie.