Major streaming apps have settings that adjust the audio quality delivered to your device. For Apple Music, go to Settings > Apps > Music, then tap Audio Quality and choose your settings for mobile data, Wi-Fi and downloads. High Quality is the best balance of data and sound; as we discuss below, Lossless is only worthwhile if you have high-quality wired headphones.
Spotify offers the same setting under your profile picture at Settings and privacy > Media quality. Free users can only select from Low, Normal and High, while Premium subscribers can also choose Very high or Lossless. For Wi-Fi streaming, Very High is good for most cases.
After enabled high-quality streaming, take a look at your equalization (EQ) settings, which let you boost or reduce certain frequencies. For Apple Music, you'll find these under the same Settings > Apps > Music menu. Select EQ, then pick from the list of music types depending on what sounds best. Unfortunately, you can't create a custom EQ in Apple Music. Meanwhile, the Sound Check feature normalizes the volume level across all tracks. People are mixed on this; some claim it reduces audio quality, while others appreciate not having to adjust the volume regularly. Give it a try both on and off to see what you prefer.
For Spotify, you'll find these options by tapping your profile icon, choosing Settings and privacy and selecting Playback. Tap Equalizer to enable it, then choose a preset or drag the dots for each frequency to fine-tune the sound to your liking. The Volume normalization slider is at the bottom of this page; if you use it, don't choose Loud for best quality.