While it's easy to loop a YouTube video from beginning to end, you'll need a browser extension or third-party software such as Magic Actions for YouTube in order to loop a specific segment of a longer video. You can also use InfiniteLooper, which is an online service.