Usually, when one creates, saves or converts an image, they choose the image format, geometric size (in pixels, width and height), color scheme and depth, compression type and settings (the amount of detail alowed to get lost) and that's it.
The file size is not usually set, it emerges from the image content and settings.
Of course, one can play with these ...
You can do this easily with LViewPro, a photo editing application written for Windows. One version now commonly used was originally written in 1996 for Windows 95, but works perfectly in Windows 10 64bit even though the software is 32 bit. The LViewPro photo-editor is freeware, just search for it and download. To use LViewPro, start the application, ...
You can use ImageMagick:
convert original.tif -define jpeg:extent=9MB output.jpg
And quoting one of the comments:
IrfanView will allow you to do it, for those on Windows who are afraid
of the command line
Let me qualify this 'simple' solution by saying that such as LinkedIn, same as any other social media site, will not care a jot what size an image is, so long as it falls over and under certain sizes in [mega]bytes [& possibly over or under a certain size in pixels]. They're not photographers or graphic designers, their interest is simple ...