a line segment
A pencil drawn across the page from one dot to another, a fence rail between two posts, the edge of a ruler — each is a piece of a straight line with a clear beginning and end. That bounded piece is a line segment.
A segment is named by its two endpoints: segment AB consists of the points A and B together with every point that lies between them on line AB. Unlike a full line it does not extend forever, and unlike a ray it stops at both ends. Because it is bounded it has a definite length, written AB or |AB|, which is the distance between its endpoints — and that distance is read off as the positive difference of the endpoints' coordinates under the ruler postulate. Two segments are congruent (written AB ≅ CD) when they have the same length.
Segments are the workhorses of elementary geometry: the sides of a polygon are segments, a triangle is three segments, the radius of a circle is a segment. The midpoint of a segment is the point that splits it into two congruent halves, and the segment addition postulate lets us combine lengths — if B is between A and C then AB + BC = AC. Keep the object and its length apart in your mind: 'AB' can mean the segment itself or the single number that is its length, and good notation (|AB| for the number) avoids confusion.
Segment AB with endpoints at coordinates 2 and 7 on a number line has length |AB| = 7 - 2 = 5. Its midpoint sits at coordinate (2 + 7)/2 = 4.5, splitting AB into two congruent halves each of length 2.5.
A segment is bounded at both ends, so it has a definite length and a midpoint.
Distinguish the three relatives: a line runs forever both ways, a ray forever one way, a segment stops at both endpoints. Don't call a segment a 'line'.