Download windows here
Then run this tool and check off anything you want, like disabling onedrive, cortana, web results in search, etc..
You can use this tool to easily bulk remove any pre-installed apps that you don't want.
I don't recommend running big debloater scripts, they often remove useful things and can break things.
For installing software you can use winget
which is built into windows. For example:
winget install TheDocumentFoundation.LibreOffice
and
winget update --all