Draw, if not in line mode. To get in line mode, click the line button. Then you can make your line. Press the line button again to confirm your line. Same with the rectangle. Press it once to make it then press it again to confirm. Press "render" at any time to render your drawing. Press "space" to erase everything. You can use the variables to adjust the color, size, and shade. When you like how it looks, press "s" to show the list to copy from. You can copy the code shown. That is your code. To use a code press c while you're in the program then paste it.
https://scratch.mit.edu/discuss/topic/47475/?page=1#post-393478 post your codes up there :)