My zefal hp x 4 full frame bike pump internals have rusted out. I now have a Lezyne mini pump. What maintenance should I do on the pump to make sure it does not rust out?
As @DanielRHicks indicated in a comment, as far as preventing rust, you can disassemble a mini pump to let the internals dry out. This video shows how to disassemble a Lezyne mini pump. I am not 100% certain, but I think the Lezyne pumps may not have any steel parts, which should reduce the likelihood of rust.
Answering the question more broadly, rubber o-rings are commonly used inside pumps to form airtight seals, e.g. between the piston and the walls of the pump. Rubber compounds will degrade with time due to oxidization. You can't stop this process any more than you can stop entropy itself (although I have a Lezyne mini that's over 10 years old, and it's still airtight, so it might take a while). However, if Lezyne still offers spare parts when this happens to you, you can buy a replacement o-ring kit, e.g. here, and then replace the o-rings. Dirt may also get inside the pump internals, and as the video shows, you can simply wipe off and regrease the internals. I'm not extremely familiar with grease types, but silicone grease as Daniel recommended is used for metal to non-metallic components (whereas lithium grease is for metal-metal interfaces), so this would be the type to use.
Lezyne does offer spare gauges, chucks or heads (the part you plug onto the valve), and hoses for both their mini and floor pumps. To my personal knowledge, Silca also makes a big point of offering spare parts for its pumps (which are premium items, so one would hope that they did). I would assume that most major manufacturers, like Zefal, should offer similar spare parts.
Another maintenance task you can do is TEST your pump periodically. And that doesn't mean waiting till you get a flat and need it!
The general recommendation is to give your bike an M check monthly. Simply pull the pump off its mount, seal the end with your finger, and give it a pump or two. If water comes out anywhere, or if there's no air pressure behind your finger, then look further.
I went over a year with no flats on a road bike. When I did get one (25 km from home) the topeak minipump was there, but as I extended it the two ends did not stop and became two separate pieces. Turns out a part had unthreadded with vibration, and the handle was only sitting in the secured base. Now I check my pump more often, and carry a co2 bottle as backup.