Using a phone or tablet, I lie on my side so my arms are resting beside me instead of out in front of me. I have to put orientation lock on so that the screen doesn't turn when I turn the phone/tablet that way. I tend to turn from one side to the other regularly to avoid getting stiff. For texting, you can also use Siri (for iPhone) or Cortana (for Microsoft phones) to write the texts from your voice. I'm sure most phones these days would have something along these lines, just try googling something like "how to write texts from speech on (insert type of phone)". On iPhone, you can also send voice memos I think.
Using a laptop, I rest it on my lap with my knees up if I can, so that the keyboard is easy to reach. I'm usually positioned with pillows so my head is slightly propped up.
If I have my legs down and the laptop flat on my thighs, I prefer to have it on a laptop tray (like a stable table) for a bit of extra height. As my left arm is a little higher (the one that's always on the keyboard) I like to put a small cushion or something to prop up my elbow, so it takes less energy to hold my hand on the keyboard. I usually have a proper mouse (I play games on my laptop) so I keep that on the bed beside me and position it and the mousepad so I can lay my arm out relatively straight. A cordless mouse can be a good option so it is easier to move on and off the bed as required.
I also sometimes use a neck pillow (like people use on planes) for a little extra support for my neck if it starts to get sore.
If you are using a desktop computer instead (wasn't sure what you meant by monitor but thought maybe you didn't have a laptop?) you can also buy cordless keyboards. I got a cordless keyboard and mouse set from JB Hifi for only $20 and they work great.
Another option is an over-bed table on wheels. I got one from Aldi (they have them again this weekend for anyone in Aus) which I sometimes put my laptop on. If you go this way, I recommend keeping the mouse down beside you still, as it's much less tiring, and use something to prop up your elbow.
Sorry for the long message, I spend a lot of time with computers and have trialled lots of options to make things easier when I'm not good lol I tend to have quite the collection of stuff in bed... I think it makes life much easier on a bad day. Good thing I have the whole queen bed to myself (fiance sleeps out the back now as we sleep different hours), I can't fit another person in here - only enough for me, my computers and my kitties teehee