When you post/reply, notice the row of buttons on top of the text area? There is a button called "code".
Select your copy pasted code and click the code button. Use the preview button at the bottom to confirm you got it correct.
I tried that and when I previewed it didn't look any different than if I was to just paste the code I have in here. To make sure I understand do I paste the code first then click on the "code" button?
Yes.
Paste your code.
select it click code button. You will notice the code and /code tags enclosed in [] inserted at the start and end of the code.
Submit.