When the desired area of the screen appears inside the rectangle, you just need to press Enter to save the picture on your desktop.
What other ways can I take a screenshot of the screen in macOS Mojave
Until recently, there were 3 options for creating screenshots:
To take a screenshot of the entire screen, press Command + Shift + 3.
Bonus: Command + Shift + 6 allows you to take a screenshot of the Touch Bar, if available on your MacBook. [Apple]