Window detail please

Hola, how do people detail the connection between panelling/ furniture and where it meets the window. Ideally I’d like a peice of timber for a shelf but don’t want leave a gap but also don’t want to two materials rubbing.

There are many ways to accomplish this, I’d check out YouTube for various ideas to choose from.