To cancel Apple Music via iOS or iPadOS, go to Settings > (Your Name) > Subscriptions. Click on the Apple Music subscription, then hit Cancel Subscription. Your membership will not stop until the end of the monthly billing cycle, so you can listen to music until then.