I'm an iPhone 5s user and I'm trying to update my phone from IOS 9.3.5 to 10.2.1. How can I update to version 10.2.1?

My phone keeps saying that it can't update, because I'm no longer connected to the Internet, but I'm connected to Wi-Fi. I would appreciate the help.

IOS 10.2.1 isn't being signed anymore which means it's impossible to upgrade to it unless you happened to have saved the SHSH2 Blobs while it was still being signed. If so then you can use FutureRestore to update to your 10.2.1 Blobs.

I'm assuming you want this for jailbreaking? As you're on 9.3.5 which is jailbroken and 10.2.1 recently got a jailbreak. I'm sorry to say but if you didn't save your SHSH2 Blobs then the only version you can update to is iOS 11+

Also, you most likely can't see any updates because you're jailbroken which has disabled the OTA updates for iOS. You would need to remove your jailbreak completely for it to show the updates.