I have dealt with this problem myself and i have done extensive research on the matter. I have been to www.apple.com and all different kinds of forums and things as that such. There are 3 things you can do with different things that happen. If you follow the simple directions, then you can figure out the passcode and be on your way to listening to music again. [This is not included for the shuffle because it does not have a screen, so if your here about that then i will probally recommend that you have a problem with your ipod and you need to find someone who can fix it or go buy another one.] Anyways, heres the simple way to get the passcode without deleting any songs or harming your ipod.
1.Plug the iPod in computer.
2.Go to "My Computer" And click the apporiate drive your iPod.
3.Change the folder option to "View all hidden files and folders"
4.Navigate to ipod_control
5.Then go to Device
6.Then there is a file there named"_Unlocked"
7.Open that up with a text editor (Notepad) and viola the passcode is right there
Ok the second thing that im not sure does work is the just plug it in the computer pull up itunes and take it out thing without pushing eject, and it has to be on the original synced computer and has to be OFF.
The third thing is restoring it. Here are the directions straight from apple.
Restore
Warning: Because Restore erases all of the songs and files on the disk, make sure to back up any files you've saved on the iPod disk. All of your songs, podcasts, and audiobooks can be loaded back to your iPod shuffle provided that you have them stored in your iTunes Library.
How to restore your iPod:
For Windows:
1. Make sure you've reinstalled the latest version of iTunes.
2. Open iTunes, and then connect your iPod to your computer.
3. After a few moments, it will appear in the source list in iTunes.
4. Select your iPod in the source list and you will see information about it appear in the Settings tab of the main iTunes windows.
5. Click the Restore button. You will be prompted with one or more restore options that may prompt iTunes to automatically download of the latest iPod Software. The 4 possible restore options are:
Restore Option 1: Restore - Restores with same iPod Software version already on iPod.
Restore Option 2: Use Same Version - Restores with same iPod Software version already on iPod even though a newer version is available.
Restore Option 3: Use Newest Version - Restores with the latest iPod Software on your computer.
Restore Option 4: Restore and Update - Restores with the latest iPod Software on your computer.
6. A progress bar will appear on the computer screen indicating that the first stage of the restore process has started. When this stage is completed, iTunes will instruct you to leave iPod connected to your computer to complete restore.
7. During the stage 2 of the restore process, the iPod will show an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remains connected to the computer or iPod Power adapter during this stage. Note: The progress bar may be difficult to see since the backlight on the iPod display may be off.
8. After stage 2 of the restore process is complete and the iPod is connected to the computer, the iTunes Setup Assistant window will appear asking you to name your iPod and choose your syncing preferences similar to when you connected your iPod for the first time.
If Restoring was unsuccessful, try the iPod Reset Utility.
--------------------------------------------------------------------------------
For Mac:
1. Make sure you've reinstalled the latest version of iTunes.
2. Open iTunes, and then connect your iPod to your computer.
3. After a few moments, it will appear in the source list in iTunes.
4. Select your iPod in the source list and you will see information about it appear in the Settings tab of the main iTunes windows.
5. Click the Restore button. You will be prompted with one or more restore options that may prompt iTunes to automatically download of the latest iPod Software. The 4 possible restore options are:
Restore Option 1: Restore - Restores with same iPod Software version already on iPod.
Restore Option 2: Use Same Version - Restores with same iPod Software version already on iPod, even though a newer version is available.
Restore Option 3: Use Newest Version - Restores with latest iPod Software version on your computer.
Restore Option 4: Restore and Update - Restores with latest iPod Software version on your computer.
6. A message will appear prompting you to enter an administrator's name and password.
7. A progress bar will appear on the computer screen indicating that the first stage of the restore process has started. When this stage is completed, iTunes will instruct you to leave iPod connected to your computer to complete restore.
8. During the stage 2 of the restore process, the iPod will show an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remains connected to the computer or iPod Power adapter during this stage. Note: The progress bar may be difficult to see since the backlight on the iPod display may be off.
9. After stage 2 of the restore process is complete and the iPod is connected to the computer, the iTunes Setup Assistant window will appear asking you to name your iPod and choose your syncing preferences similar to when you connected your iPod for the first time.
OK if you have any questions you can submit something about it. I hope that any questions you did have though, this awnsered them.