Hi @Satya Revanth Kumar Majji (AU) ,Thanks for reaching out.
The content endpoint on drive item returns a stream. In order to edit a word or PowerPoint document you need to use some library to get the document from a stream. one such popular third party library is Aspose. You can load the document using aspose and edit it programmatically.
Once the document is edited you can save it and upload it by using graph api (in the upload api of the graph use conflict behavior as replace)
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".