I want to know how you should format text like Google Docs does, allowing you to select text and make it bold, while at the same time being able to edit it. If you could tell me how to implement the same with markdown as well, please do so!
Note
I want to be able to see the formatted output while editing, not just after editing on some different screen/file.
If you mean a Rich Text Editor you can use Quill. If you want a Markdown Editor you can use SimpleMDE or Cherrywriter.
SimpleMDE automatically gives you a toolbar to format the markdown and the editor will convert the markdown to a visual format while editing (taking notes from your note).