Without additional knowledge of your mailbox organization, only high-level advice is possible.
If you are using IMAP, and you know the subject and/or index within the mailbox of the message you want the attachment from, it's pretty much a schoolbook example of how you use IMAP on the protocol level. I cannot point to any canned command-line IMAP client, although e.g. the
Perl IMAP libraries (and I imagine the Python ones) probably have all you need, including a working example of something very close to what you need.
If you are using POP, it's basically similar, although the details will be different, and the protocol doesn't offer direct access to individual attachments within a message, if I recall correctly.
If you are using a local mailbox, it's not "downloading", so I guess that's not what you need, but if you know how to accomplish what you want on an individual local message, that's of course already a good start, and all that remains is the downloading part.
I don't particularly recommend csh for scripting, and apart from its general limitations, it certainly does not offer facilities for connecting over the network. You can invoke external programs which do that, but then the main body of the script will be in a different language; that of the network client.
If this is for school (which somehow the tone of the "assignment" resembles) then you should know that this site frowns upon posting homework.