Usually, what I do for simple commands in a phrase is :
- Write it
- Select it
- Then click the symbol </> on top of the editor (or on my mobile, it's the "Preformatted text" in the cog wheel)
With larger portions of code (button, script), I start on a new line with that button (</>) then paste the code. Hitting the button creates three lines with the one in the middle selected (which is replaced when pasting code):
```
type or paste code here
```
Then on the first line (```) I add the language when it's javascript (as described in the formatting tips).