I bought a cast iron skillet and after washing it and then heating it I got a color like rust
This has happened because you didn't dry it thoroughly enough. 

I would advise starting the seasoning process again. This is a good visual guide from Joshua Weissman: https://www.youtube.com/watch?v=PDTCgxvmShc