I plan to replace my old HDD from the notebook with a new SSD.
However, I do not know how I do it with the data or especially with the operating system. After all, I bought the notebook with the OS installed.
You install the SSD and then install a fresh Windows from a Windows installation stick. You can create this in advance using the MediaCreationTool.
It depends on what you have with your notebook. If you only have a Windows key, you first have to get a Windows installation DVD to reinstall Windows.
To get the data back into the notebook, you need an external hard drive housing for your old disk and then copy it over after installation.
However, if you want to keep the system, you could pack the new hard drive in an external housing, connect it and then copy the entire old hard drive to the new one with the appropriate clone tools. Then you simply install the new plate.
You can find descriptions of this on the Internet. E.g.: