Start by making a local backup of your emails on your computer. If you are using Outlook then you need to make a backup of your .pst file. Check out the links below for instructions.
File > Open & Export > Import/Export > Export to a file > Outlook Data File (.pst) > Do not export duplicate items and set password for your PST file
You should now set up your account with IMAP, using the same password.
When you are done, check if you can send and receive emails and everything is working. Note that your IMAP account is probably missing some emails.
Now it's time to export the emails from your POP account to your IMAP account. In most clients, you may select your new IMAP account and click File > Open & Export > Import/Export > Import from another program or file > Outlook Data File (.pst) > Replace duplicates with items imported
When all emails are moved, and your IMAP account is working as expected, you can remove the POP account from your email client.