I see you are using macOS 10.13 (High Sierra). If you upgrade for more recent MacOS like Catalina or BigSur you will get this feature automatically. It is already at the sidebar in finder.
If you can't or don't want to upgrade your system, you still can achieve this by creating a smart folder with Finder.
- Right click the Finder in the Dock
- Select New Smart Folder, a finder window will show up with some options to choose.
- Press the plus button at the upper-right corner
- Select Last Opened at the drop-down
- Select 'This Mac' to search in all computer
- Save your smart folder. When saving, make sure 'Add to Sidebar' is checked.
- It will be saved and you have it at your sidebar.
- If you want to have it at the dock, just drag the item from the sidebar to the dock.
- Enjoy.