There are two words for a thing in Japanese. こと and もの.
もの refers to a physical object (flower, hat, pencil).
こと refers to something non-physical (an idea, an event, an action).
There exist two different と particles.
The と “joining” particle serves the function of “and”.
The と “quotation” particle serves the function of communicating something as being a quote.
The quotation particle comes after a quote within a sentence.
The と quotation particle is used in addition to the square quotation brackets used in Japanese.
そのとき is a relative time expression, meaning “that time”. It is placing the sentence into the same time that was established prior to it’s use.
Relative time expressions do not require the usage of anything to function within the sentence, they are simply placed at the beginning and no particle is required.
When pushing two nouns together, the second noun is changed so that the first kana is it’s だくてん (dakuten) equivalent, if one exists (i.e とけい → どけい).
The と quotation particle
The と quotation particle takes a whole quotation and turns it into a noun.
と then makes the noun (quotation) function as a modifier to the verb that follows.
The と quotation particle provides extra information regarding the action of the subject of the sentence, the person or thing that the quote is sourced from.
It isn’t uncommon for a verb addressed to somebody in the て-form to actually be a shorthand for てください.
The quotation particle can also be used for sound effects. To quote the sound to show how the action was taken (e.g でもウサギはピョンピョンとはしりつづけた = The rabbit continued running like “pyon pyon”).