It would seem, what could be simpler? However, for beginners, this can be a real problem, since the triangle shape is not available in the standard Adobe Illustrator tools.
Method one. Select the Pen Tool ([P] key) and click three places in the work area to get a triangular shape and a fourth time at the first point to close the path. You can also close the contour by selecting three points and pressing the key combination [Ctrl + J].
Method two. Select the Line Segment Tool ( key) and draw three straight lines so that the end of the previous line coincides with the beginning of the next (the end of the third line should coincide with the beginning of the first). Select the resulting lines and press [Ctrl + J] to close the path.
Method three. Select the Rectangle Tool (Key [M]) and draw a rectangle. Then select the Delete Anchor Point tool ([-] key) and click on one of the corner points of the rectangle to delete it.
Method four. Select the Polygon tool from the same menu as the Rectangle. Click on the work area and, without releasing the left mouse button, you can press the up and down arrows on the keyboard to adjust the number of corners of the polygon.
The fifth method. Select the Star tool from the same menu as the Polygon. Click on the work area and, without releasing the left mouse button, you can press the up and down arrows on the keyboard to adjust the number of ends of the star.