Hi Helen welcome to the Decorating Forum

.
It is hard to explain without pictures. We saw it on Better Homes & Gardens TV years ago.
So you have 2 pieces of picture framing timber. The reason you use picture framing timber is that it has a groove or a step down in the profile routed out already for the glass to sit in it. You attach 1 piece of picture framing to the wall with the wider part being at the bottom, and the routed out part being at the top. Then you attach the 2nd piece of picture framing to the bedhead. But you attach this the opposite way so the widest bit is at the top. This hopefully will all make sense when you have the 2 pieces of picture framing in your hands. Then you sit the picture framing timber on the bed so it is resting on the picture framing on the wall.
When my DH did this I was sure it would fall off or be easily knocked off. 5 years later they are still sitting pretty on the walls

.