In most cases, primary sources are unpublished sources. For example, letters, post cards, photographs, ledgers, deeds, meeting minutes, meeting agendas, diaries, manuscripts (the first drafts of books or unpublished books) can all be considered primary sources.
In some cases, published sources can also be considered primary sources. For example, studying publication runs of LGBTQ+ magazines, despite being published, these magazines become primary sources because they are the object of study. This can hold true for books if we are studying all the works of an author, this could hold true for newspapers if we are studying the press coverage of the Women’s Suffrage movements in different countries and regions. It all is a question of what is being studied.
When in doubt, speak with a librarian, an archivist or your professor if you require a second opinion on whether something is a primary source or not.