A picture of this question would be quite useful, or a scribble something like it.
But I'm assuming the line is drawn on a 2D drawing of the part. Imagine that this part is lying on the table in front of you so that you see the exact same view of it as drawn. If you take a super sharp knife and cut along the dotted line AB, all the way down the piece like cutting a potato in half, that's your section. Then you take the LEFT piece and place it so that you are looking at the cross section you just made. Then you draw this.
You cut the part all the way along the dotted line, so if this extends all the way through the part, you draw the part as above. However, if it extends part way though, it's like you made the cut (all the way down to the table, but not all the way through the potato) and then tore off the right chunk - you'll have a section view for part of it, and a complete view for the rest of it, with an interface in between where you've torn it.