と and や: listing nouns
と and や frame lists of nouns differently. Decide whether you are presenting a complete list or representative examples, and distinguish noun lists from lists of actions.
Make a list with と
パンと卵を買いました。 means 'I bought bread and eggs.' と joins the two named items into a list. The を after the final noun applies to that whole group.
Using と does not logically deny that you bought anything else that day. It presents the named items as a complete group for that statement, without explicitly signaling that they are examples from a larger list.
Give examples with や
パンや卵を買いました。 means 'I bought things such as bread and eggs.' や presents examples from a larger set. You can also add など after the last item: パンや卵など.
If you need to communicate a complete packing list, do not rely on や to make it exhaustive. For representative hobbies or examples of goods a shop sells, や can fit the intended meaning.
Recognize other uses of と
In 友達と昼ご飯を食べました。 ('I had lunch with a friend'), と marks a companion. It has the same written form as the listing particle but a different role. Read it together with the action.
Do not directly substitute the noun-listing と when connecting actions such as reading and listening to music. Choose a suitable pattern, such as the te-form or たり, according to whether you mean a sequence or examples of activities.
Check: Which suits an example list in 'On weekends I buy groceries such as bread and eggs': と or や?
Show the answer and why
や fits: 週末はパンや卵を買います。 presents the two items as examples. と presents the named items as a complete group within that statement.

