This uses the cluster.routing.allocation.exclude cluster setting to drain a node of its stored shards so you could shut down a node safely (Cluster settings - OpenSearch Documentation)
I have not tried this on my test-setup but I think the workflow would look roughly like this:
Exclude the node from shard allocation
Power off the node
Upgrade to the more powerful HW/VM
Install OpenSearch and join the cluster
Enable shard allocation again
Wait until cluster health is Green again and repeat with the remaining nodes