Before you start, turn off the laptop, unplug the adapter and remove the battery.
Removing RAM module located on the bottom.
First of all, remove the memory cover.
Spread latches located on both sides of the memory module until the module pops up at a 30 degree angle, as it shown on the picture below.
Grab the memory module by the edges and pull it from the slot.
Removing RAM module located on under the keyboard.
The second memory slot is located under the keyboard, so we’ll have to remove the keyboard first.
Remove four screws securing the keyboard.
Insert a small flathead screwdriver between the keyboard and palm rest and carefully lift up the keyboard.
Place the keyboard on the palm rest so you can access the cable.
Disconnect the keyboard cable from the motherboard. Now you can access the second memory module.
Remove the internal memory module the same way you removed the first one.
On the picture below you can see the original module.
According to the official hardware maintenance manual for ThinkPad T40/T40p, T41/T41p, T42/T42p, these laptops can take up to 2GB memory total. You can install up to 1GB memory module into each slot.
You should use PC2700 (DDR-333) 200-Pin SODIMM RAM.