The paper presents a comprehensive guide for researchers investigating mind-wandering and related phenomena such as involuntary past and future thinking. Examining such spontaneous cognitions presents a challenge requiring not only the use of appropriate laboratory-based procedures, but also the coding of complex qualitative data. This guide outlines two main stages of existing research protocols: data acquisition and data coding. For the former, we introduce an easily modifiable computerized version of the vigilance task, designed for broad application in studies focusing on eliciting and measuring involuntary thoughts in controlled laboratory conditions. Regarding data preparation and coding, we provide a detailed step-by-step procedure for categorizing and coding different types of thoughts, involving both participants and competent judges. Additionally, we address some of the difficulties that may arise during this categorization and coding process. The guide is supplemented by a clip demonstrating the main part of the experimental procedure and a step-by-step example of the subsequent data processing stages. We anticipate that this research guide will not only assist a broader group of researchers interested in investigating spontaneous cognition, but will also inspire future studies on spontaneous cognition and related phenomena.•There is a need for standardized approaches to working with qualitative data when investigating spontaneous thoughts.•The paper outlines a comprehensive protocol for collecting and coding involuntary past and future-oriented thoughts.•The paper also presents a detailed step-by-step procedure for data preparation and coding to categorize different types of thoughts, involving both participants and competent judges.