Can you somehow replace the processor on a laptop with an AMD Ryzen processor?
No, I'm assuming you have an APU.
Like a single CPU, this is almost always soldered in place.
In this respect, this effort will not be worthwhile.
It depends on what equipment you have for soldering, how much patience you have and whether the cooling solution integrated in the laptop would also be sufficient for the new processor.
Usually they are firmly soldered to laptops.