First you need to figure out whether you hold the rights to that code. This depends on your jurisdiction and contract. E.g. an employment contract may state that the rights to any work you do that is related to your employment belong to your employer. Here, it seems this would be directly related to your employment even if you coded this on your own time.
If you hold the rights, you can issue a license. You won't lose your copyright by issuing a license. It is recommended that every source file gets a comment at the top that notes your copyright and mentions the license. Then, put the actual license into a separate file or into the README of your project. You don't have to publish your code publicly, but it's probably helpful. GitHub, Bitbucket, and Gitlab are a few gratis options for hosting open source projects.
Which license you should choose depends on your goals. All open source licenses allow commercial use, but not all allow inclusion in proprietary products.
- Copyleft licenses such as the GPL maximize end-user freedom, at the cost of restricting developers.
- Permissive licenses such as Apache 2, MIT, or ISC maximize developer freedom, at the cost of end-user freedom.
You are therefore likely to be interested in a permissive license. The mentioned licenses all require that your copyright notices are preserved. The ISC license is a simplified/modernized MIT license. Both MIT an ISC are very compatible with other licenses. The Apache 2 license is more thorough, and also covers trademarks, patents, modified versions, and additional legal notices. Using Apache-licensed code takes a bit more effort to comply with these requirements.
Before you choose a license, consider asking at work which licenses can be used, or whether there's a pre-approved list of licenses.