Use a paper clip and bend out one end. Just like you would if you were going to eject a CD from a CD player that is broken or jammed. The Sim Card tray is located on the top side of your iPhone. Locate the Sim Card eject hole and place the paper clip (pointy end) into the hole and the Sim Card will eject on its Sim Card tray. Take care not to touch the gold contacts of the Sim Card and if you do not put the card straight back into your iPhone then place the Sim Card tray back in the iPhone making sure it is the correct way up and carefully push it home until it is flush with the iPhone surface.
Place the Sim Card somewhere safe. I use SD memory card holders or similar to protect the Sim Card. Your iPhone will still function as an iPod and web browser using WiFi you have access to and not the WiFi that might be part of your mobile companyâ€™s package. Also EDGE or GPRS etc will not function along as these are part of your iPhoneâ€™s telephone which needs the Sim Card to connect to the network and authorise and bill your calls, data, text messages etc.
You can place your iPhone Sim Card into most other mobile telephones and get basic telephone functions like making and receiving calls but date and WiFi etc is unlikely even if you have access to WiFi date or other data technologies on your other phone. You might find that a non iPhone Sim Card will not work in your iPhone and if it does it is unlikely you will have any data functionality.
Also take care that you preserve any data such as contact information.