If you mean the ROM (system software) there are two ways:
1) wait for an official update for your phone. You should then be able to download and install directly on the device. Check for software updates in the About menu in the phone settings.
2) Root the phone and install a custom ROM, provided someone has written one for your phone. Rooting and ROMs are device-specific, so for more information you should visit the section of AF for your device - since I don't know what phone you have I can't really say more.
If you actually mean RAM (Random Access Memory) there is no way to change that - it is soldered to the motherboard.