We need to back up a bit..
Apple has two main music services. They have iTunes which is a digital store where you can buy or rent content like music, movies, TV shows, etc. You pay one time for each content and there are no subscriptions.
The other is Apple Music. This is a streaming service that you subscribe to and pay every month for the "privilege" of listening to music. You don't own anything at all through Apple Music. When you stop paying for the subscription (or don't renew after your trial ends), all of the music you downloaded for offline listening will not play anymore.
On the other hand, if you bought music through the iTunes app, that music is yours. You can play it on any compatible device as long as you sign in with the same Apple ID that was used to purchase it.
The iTunes program for PC lets you access both the iTunes store and Apple music.
Apple Music has DRM (Digital Rights Management). This is to prevent you from being able to copy the music files and play them without a valid subscriptions. There are some programs that "claim" to be able to remove the DRM, but I don't think they work well.
If you have Apple Music (based on your description), you will not be able to play any music after you end your subscription since that music isn't yours. Apple is simply allowing you to listen to it for as long as you keep paying.
If you bought your music through iTunes, you can download your music on any compatible device.