There are many ways to do sit-ups in bed. If you lie on the mattress, you can perform most exercises that work your abdominal muscles, but you'll have to work harder to maintain your balance.
By placing your body on an unstable surface, like a mattress, you force your muscles to work extra hard to stay stable and balanced. Therefore, exercising them in this environment will help them work to their full potential.
If you're a beginner, it's best to work your abs on the floor and start slowly.
However, these exercises won't be of much use if you don't adopt healthy lifestyle habits that help you keep your body in good shape and free of excess fat. Keep in mind that the abdomen is one of the areas where most fat accumulates, and to lose it, you must adhere to a healthy diet.
I'm a 51-year-old grandmother, and I do them to keep myself strong even as the years go by.
ABUELAFITPERU