Welcome @Rabin1 !
In ReleaseNotes/25.8 there is a link to the Wiki page on how to create a custom context menu in Calc:
• With the contextmenu.RemoveAllItems() method, you can opt for configuring a totally customized context menu. Example in Wiki: context menu.
⠀

⠀
It seems that LibreOffice Help does not address the ContextMenu service at this time.
In the comment at the beginning of the SF_ContextMenu module
(under the Application Macros and Dialogs ⟶ SFWidgets) one reads:
''' Detailed user documentation:
''' https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03/sf_contextmenu.html?DbPAR=BASIC
AFAICT the sf_contextmenu.html file (or .xhp for that matter) is not available.
Anyway, in the said comment you shall find the example for Writer too.