Many graduate programs require a sample of your writing as part of their application. This is especially true for Ph.D. programs (both in clinical and experimental psychology and cognitive science), but I've seen this as a requirement for other types of graduate programs as well. Although some programs make this part of the application optional, chances are that if you choose to apply to graduate school, one of the programs you apply to will require a sample as part of the process. Much like whether you should take the GREs, you probably want to think about picking out a sample of your academic writing for this purpose.
I have been thinking back to my own experience applying to graduate school, and I can't remember if I had to submit a sample of my writing. I think the answer is no. I remember writing a research statement, which was about the kind of research I wanted to do, and several of the schools had specific prompts for this purpose, as well as a personal statement, which was more of a narrative about myself and something that I reused across my applications. But I can't recall whether I submitted a sample of my writing in addition to that. Now, that personal and research statement are usually combined into one document, which will be the subject of another post.
This post is about how to choose a writing sample and give a little insight into how that sample is evaluated.
So, an important point here is that you want to prioritize academic writing. Here's a story: When I was in 11th grade, I had an English teacher who made me appreciate poetry. So, I started to read some poetry, and then started to write poetry. (Look, I was a teenager and going through a lot of stuff. It was a weird time), When I got to college, I discovered that there were a few other students around my campus who also did this, and there was a poetry workshop club, where we all exchanged ideas and read things together. So, I kept doing this for a while. I even published a few poems in a poetry magazine (got a check and everything, so I can officially say that I was a professional poet at one point). I was actually pretty decent at writing poetry. (Or so I thought...when I got to graduate school at Berkeley, I took several poetry workshop classes after I had finished most of my course requirements for my graduate program. Those classes had Ph.D. students in English and Comp Lit, and they were taught by real poets (Sharon Olds, Thom Gunn, Robert Haas). Holy moly, that was a different world.
My point is that even though I did a lot of things wrong when I applied to graduate school, I knew not to submit poetry as my writing sample.
So, that's the first take home message: Submit a sample of academic writing. If you are already graduated and did a thesis, more likely than not, you're submitting the thesis. If you didn't do a thesis, but did do a CLPS1980, then you're probably submitting the document you wrote for that experience (and if you didn't write a final document for your CLPS1980, shame on your advisor!).
But what if you didn't do either of these things? Well, do you have a paper from a class that you are especially proud of (which usually correlates with a paper on which you were evaluated well)? That's a good possibility.
It does help if the paper is a paper about psychology (or in a related discipline to where you are applying), but it does not have to be about the topic you are applying to work on. This is not about demonstrating your knowledge. This is about demonstrating your academic writing capacity. Your readers are not reading it to evaluate what you know. Rather, they are reading it to evaluate how well you can write. Clarity of expression is probably the most important trait to focus on.
It helps, by the way, if you present a little blurb at the beginning to articulate the nature of the sample you are submitting. If it's a thesis, say that. If it's a paper for a class, say what the assignment is. That's perfectly OK, and honestly, a good practice for helping your evaluators work through what this looks like.
Now, a final word about evaluation (And this might be a separate post all together, but I might just point to this idea now). Here's how I evaluate graduate candidates. I make a rubric. I'm not going to give you all the things on that rubric, but writing ability is one of them. I use the writing sample to evaluate writing ability (along with the personal statement). But critically, that's the only thing I use the writing sample for. So, this gives you some insight into how I evaluate candidate, and the value I place on the writing sample (i.e., relatively low, as it is only part of one item on my rubric). The idea of using a rubric is common (many faculty I know do this, and it's highly encouraged), but every faculty member has a different rubric. Mine does not value the writing sample that highly, and I suspect (although have never confirmed), that this is a common practice. However, others might do things differently.
So, my advice, if you were applying to work with me, is to value other parts of the application more than the writing sample. It's not unimportant - it's that other things are more important. But definitely academic writing in the field of study, and it helps to have a primer for what the evaluator is going to read.
Two final points. First, a lot of applicants submit manuscripts, if they have them. This is a challenging practice for evaluators, typically because a manuscript is written in collaboration with a more senior individual (like a faculty member, who has more experience writing). Evaluators know this. I personally ignore manuscripts that are co-authored (I use other documents to determine the writing capacity on mu rubric, like the personal statement). But others like to see manuscripts, so it's a mixed bag. If you have a paper that you really like, that best represents you, then I might recommend that more than a manuscript (and you can even say this in your primer - something like "I could submit a manuscript, but it was co-authored with XXX. This document represents more of my independent work").
Second, I was a terrible academic writer as an undergraduate. I really was. My biggest problem as an undergraduate was my lack of writing ability. I succeeded in college because one major (computer science) had no papers, and I could get away with doing well on tests and projects in the other (psychology). My overall GPA as a college student was low because I kept taking classes that required significant writing (like English and Linguistics classes; don't ask me about the paper I had to write about Crime and Punishment for a Modern Novel class). You don't have to be a great writer to go to graduate school. But you do have to commit to working on it regardless of your ability right now. If people who do science can't communicate their findings, there's not a lot of point to doing science.