This can be difficult as these internal and external issues that become part of the context of the organization are individual to each company, so the process for collecting them is also unique from one organization to another. This process can be as simple as having top management brain storm what OHS issues exist internally for the organization (such as employee culture, union commitment to OHS, etc.) as well as what issues exist externally for the organization (such as changing equipment needs that affect OHS, new legal training requirements, etc.) Remember, these issues need to be reviewed as part of management review, so having them written down may be necessary depending on the organization.
For more on how clause 4 work see this article, “Defining the context of the organization according to ISO 45001”; https://advisera.com/45001academy/blog/2016/02/03/defining-the-context-of-the-organization-according-to-iso-45001/