Scomo we use Markdown for text formatting in this forum, so you can profit from markdown's code formatting:
For in-line code, use
```code goes here```, and for code blocks, use
For further formatting hints, see the link above. You can generally enclose code blocks in as many backticks ` as you like, but it is not advised to use just one since any non-escaped in-line backtick will close the code block otherwise.