It's virtually impossible to do this on your own. There are dozens of fingerprinting vectors that can be used to detect the operating system you are running or uniquely identify a browser, and sometimes even your individual hardware irrespective of the OS you use. Paradoxically, any changes you make to your browser configuration actually make this worse. In addition, TCP option fingerprinting makes it such that your browser alone is incapable of hiding the platform you are using, because the mere connection that comes from your operating system leaks the operating system (and even system uptime).
There is a solution, however, which is to use Tor Browser on the highest security setting. Every Tor Browser installation attempts to be indistinguishable from each other (it has a large anonymity set). It's not perfect, but it's far better than nothing. The use of Tor as a proxy also defeats TCP fingerprinting.