Controlling straight lines and edges in a subsurface modifier

I know I have been posting here a lot but I am fairly new to this software so need some assistance. Basically I am having issues with the subsurface modifier, I am trying to learn how to work the subsurface modifier, but basically I want this transition from white to black to remain straight, and stop the subsurface curving it. And how do I ensure that an edge I want to remain sharp stays sharp when using a subsurface?

The pics below demonstrate.
Subsurface 1
Subsurface 2 And here is the original without the subsurface
As I mentioned before, I want the transition between the white and the black to remain vertical, how do I do it?

Many thanks

you need to learn how to use crease
check the wiki for blender
or search video tut

happy bl

The modifier depends a lot on the topology of your model.

Can’t see much from the picture, can you upload a .blend file?

have you tried shift e ?

This worked well, thanks for the help