Depends on whether you know the person, or not. If you know him/her well, you might go for an informal inquiry. In the case the person is not your acquaintance, you better formulate it as any other job seeking inquiry.
To the style, this template always worked for me well (as advised in some job-seeking training course I took):
Each of the points above should be a single paragraph.
Firstly, you introduce yourself, possibly mentioning how you know each other if that is the case and most importantly articulating the purpose of the e-mail/letter, that is that you are seeking a job. In passing you should mention what you are doing now, position, affiliation, expected date of graduation, etc. Basically you want to motivate the other party to read further.
Second paragraph should be about the other party. What you know they do, or did in the past and highlighting whatever other positive aspects of their work, which are a relevant reason for your application. Possibly, you can mention that you learn from somebody else/opening, etc. that there is a possibility of an open position in the group, etc. The purpose here is to prepare the ground for articulating why you fit for them in
the subsequent paragraph, as well as to show that you mean it and you made your homework well (e.g. read their papers).
The third, most important paragraph, should be about you as a fit for the position, or the group. It all revolves about how you can contribute to their work and why it should be their interest in hiring you. Here you expand on the relevant experience/projects you did, about your abilities to publish papers in top journals/conferences in the field, your abilities to solicit external funding, teaching, whatever. Still you should consider how much bragging is appropriate. The message should be clear and concise: "there is a potential fit between the two of us".
Finally, I would close the letter by explaining what can be found in the attached documents and possibly what other constraints you might have. When appropriate, I also make it clear that this is of course an unsolicited application, but still I would be glad if the person would find time to review my background and reply.
Attach your CV and the statement of your research interests.
Worked for me. Also you should be as concise as possible. The length of this reply is probably already at the edge of acceptable length.