Ok, your question is a bit broad for Stack Overflow, so it's best if you ask for one small point at a time. I'll provide some resources below so you know what to start research on, then when you have questions when implementing them, it's best if you post detailed questions about each step.
You can also use this as a way to guide you into constructing your project.
5) IMPORTANT This is actually the most important step: if you are going to be 'scraping' or grabbing a large amount of images from the website, make sure the site you are grabbing from allows you to do it!. Check out this article here about scraping ettiquete, so you don't get into any trouble.
1) For number 1, the process will consist of two steps. One step is accepting the string input from the user. You can take a look at this tutorial here, or search through how to accept and handle inputs from the user. Secondly, you will need to feed that user input into what is called a 'webdriver'. The webdriver allows you to automate a web browser to browse the web for you and query for images (eg. through google images). You can find some resources about the Chrome webdriver here or online.
2) This step is done much easier than step one, just consult on how to extract from urls from the question you posted yourself. link. You could make a list of links from the results and just grab an image from a random link. To add to that, for python 3, the function you need instead is urllib.request.urlopen(url). The best practice would make use of the code as referenced here
import urllib.request
import shutil
...
# Download the file from `url` and save it locally under `file_name`:
with urllib.request.urlopen(url) as response, open(file_name, 'wb') as out_file:
shutil.copyfileobj(response, out_file)
3) This step involves using some libraries to display images from Python, you can find a question detailing it here. This step depends on which OS you are using, but you can find helpful posts on Stack Overflow for them.
4) If you want to do this without opening a browser, search up on how to use the WebDriver without GUI display, either on the web or SO.
Good luck!