how do you use a pillow?

I’m kind of new to this but I’ve been reading some stories and I’m curious to know how the whole pillow thing works when masturbating