You use the <> button on the right of the box when you post to insert code tags.
Or, if you prefer (as I do), do it manually by typing [ code ] then your code followed by [ /code ], only without the spaces at either side of the word code.
The tabs/indentation is all up to you to do manually.