Windows uses .ico format and MacOS uses .icns format for icon files. There are several online converters to convert images to icon format. Many converters don’t work properly when converting to .icns and here is a powerful converte https://iconverticons.com/online/