I am coming on the malaysian airline from Sydney and connecting to Saudia airline to Riyadh
where I should sleep in which hotel for 10 hours transit
is there a need to go through immigration counters or will
my bags be transferred directly to Saudia
Please note when choosing a hotel that Malaysia Airlines and Saudia Airlines fly from and into KLIA Main terminal, not KLIA2 (the budget airline terminal).
You'll need to clear immigration and customs to get to the airport hotel. As for transfers of bags, usually, you can check your luggage all the way through to your destinations if you're flying with the same airline or partner airline. In this case, Malaysia Airlines and Saudia are not partners. Do check with Malaysia Airlines and Saudia, to find out more about checking your bags to your destination.
Hope this info helps.
Mentioned in this answer:
If you would like to see something very unique I'd recommend to check out Tadom Hill Resorts which is not far from the Airport - you can get there easily by taxi!
I would recommend Tune Hotel - KLIA2. It's cheap and functions very well for a layover. You will need to pass emigration though, if you want to stay there.