These books offer guidance through the research and writing process. They cover the methods and sources used by historians including how to work with primary sources.
Also consider titles in the Routledge Guides to Using Historical Sources.
Although somewhat dated, these titles are still very useful for any student of history:
Reading, Writing, and Researching for History: A Guide for College Students (c. 1998) is aimed at undergraduates. It "addresses all aspect of historical research and writing" including how to appropriately engage with primary documents and secondary sources. The books listed below, though published a little while ago, continue to offer sound advice.