The Attendance activity is designed for teachers to be able to take attendance during class, and for students to be able to view their own attendance record. There is also an option to allow students to record their own attendance.
A teacher can mark the attendance status of a student as "Present", "Absent", "Late", or "Excused". These status descriptions are configurable, and more can be added. The teacher adds Attendance as an activity of a course, and then sets up the sessions for which attendance is to be tracked.
The Attendance activity can generate reports for either the entire class or for individual students. Students may also see their own attendance record if the activity is not hidden.
The optional Attendance block allows teachers quick access to the Attendance functionality, and allows students quick access to a summary report for their own attendance.
You can find instructions for how to use this activity on the Moodle documentation pages.