Good idea to cut off a bit of carpet from some where else.
Is your place furnished because you could move a piece of furniture and cut a piece from under that just make sure your cut enough off in the first place to cover the hole and more as you do not want to cut too little and have to go back for more.
I find that spare pieces of carpet can also be found on the bottom of wardrobes and left in attics and garages of rented properties so have a look around, you may have to try and wear the carpet first so to matches to the right colur maybe brushing it for a while.
Yes do trim the burnt bits away remove any dirt from the floor boards- possibly sand down the floor board and try and sweep/vac with nosel, cut to shape making sure the carpet grain lies the right way like the grain on wood, I would cut it slightly larger if possible and then squeeze it in so theres no holes gaps in the overall finish. Check it looks good and then superglue it on the the floor board and lower parts of the surrounding carpet. I would then let it dry and then put an even weight on it -pile of books. Later allow it to be walked on so it blends/wears in but do not vac it.