It's lucky the name is written up by the bed (6)
I believe the answer is:
mascot
'it's lucky' is the definition.
I know that 'lucky' relates to this answer.
'name is written up by the bed' is the wordplay.
'name' becomes 'sam' ().
'is written up' shows that the letters should be reversed in order.
'by' is a charade indicator (letters next to each other).
'the bed' becomes 'cot' (cot is a kind of bed).
'sam' reversed gives 'mas'.
'mas'+'cot'='MASCOT'
'the' acts as a link.
Can you help me to learn more?
(Other definitions for mascot that I've seen before include "Team's good-luck bringer" , "One is lucky" , "Good-luck charm" , "Luck-bringer" , "Thing believed to bring good luck to its owner or team" .)