Can you please suggest me a simple method that helps to open all internal and external links in discourse in a new window?
Consider that forcing a non standard behavior can be annoying for some users. If a user wants to open to a new window, they can CTRL+click or right click and select “open in new tab”. This is an article about it.
Yes visit your user preferences and select that option.