How to embed code in WordPress

Hello. I have a problem when I embed the codes for WordPress. Should I follow a certain process? Right now, I am just copying and pasting the codes from a page and then when I do this, it flashes the code right back at me on the screen. What process should I follow?
