Wire brush the rails/teeth......then spray with a dry graphite lube.
It goes on wet but quickly dries and will not attract dirt/debris.
Wipe the ram rod down with a dry clean cloth then wipe it down with a clean rag sprayed with silicone
DO NOT use any kind of lube that stays wet on rails/teeth.
As for your bedroom slide.......
It is motor/chain driven and can be accessed via underbed storage area. Lift up the bottom panels.
It being 'enclosed' you can use some chain lube but wipe any excess off.
Doesn't take much.