Optical flow is a computer vision technique that captures the motion of objects between consecutive video frames, crucial for tasks like velocity estimation and human action recognition. This tutorial explores the fundamentals of optical flow, discussing its two main variants: sparse optical flow, which tracks motion on select features like edges or corners, and dense optical flow, which calculates motion for every pixel in a frame. Sparse optical flow is implemented using the Lucas-Kanade method, while dense optical flow is approached with the Farneback method, both utilizing the OpenCV library. Recent advances in deep learning have also been applied to optical flow, offering improved accuracy through models like FlowNet and PWC-Net, although they require extensive training data often generated using synthetic datasets. Beyond foundational techniques, optical flow has significant applications in semantic segmentation and object detection and tracking, serving as a critical component in more complex systems such as autonomous vehicle navigation.