Characters can only cast spells if they have a feature that allows them to
The base Monk class does not have a Spellcasting feature, so if you're able to cast spells as a Monk, it needs to have come from somewhere else. Something like:
- Your Monastic Tradition offering specific spells (and only those spells) that you may cast as part of your Monk features
- Way of the Shadow is the tradition you cited that is one such example. Most (but not all) Monastic Traditions offer at least one spell that may be cast or otherwise gain the benefits of.
- Your Racial features offering specific spells (and only those spells) that you may cast
- One such example would be a Drow, who gains the ability to cast the Cantrip Dancing Lights, and once per day [each] the spells Faerie Fire and Darkness
- A Feat providing spells that you may cast
- One example is the Magic Initiate Feat, which allows you to choose 2 Cantrips from a specific spell list, and once per day cast a specific 1st level spell from that same spell list
- Spellcasting provided by multiclassing into a class that provides Spellcasting
- A Monk's ability score affinities make them well-suited to multiclassing as a Cleric or Druid, either of which would provide the ability to cast spells from their respective class
If any of these apply, then you can cast spells. Which spells you may cast is defined by which feature is providing your spellcasting ability and what it permits you to cast.
But can a Monk cast, say, Ray of Frost, or False Life, or any type of spell?
Not unless one of the features above says you can. You could, for example, become a Magic Initiate for Wizard spells, take Ray of Frost (on the Wizard Spell List) as one of your cantrips, and False Life (on the Wizard Spell List) as the 1st level spell.