I have an Epiphone SG400, and today when I played I heard that the B string is out of tune when I press on higher frets (8-12 frets). I tried to change the action and intonation, but now the all of the strings are out of tune when I press on any fret. How can I fix it?
Changing the action is more than merely adjusting the height of the bridge - which on SG is by the two larger screws - one each end of the bridge. The neck relief is part of that adjustment.
That aside, assuming the action is to your liking, then the intonation gets adjusted via the six saddles, one for each string. They change the open speaking lengths of the strings, which will generally all be slightly different. Usually,(but not always) there will be a roughly straight line, diagonally, between top (shortest) and bottom. Except very often, the B string is out of line, being slightly longer than 1st and 3rd. However, using a ruler to determine this isn't the way! It's done by comparing the harmonics with the fretted notes. I usually use 12th fret and 19th fret as datum points.
When strings are replaced, particularly with different gauges, the intonation will need checking, and often changing.
Firstly, this is an Epiphone which means it doesn't have the same tolerances of a Gibson.
For example I have an Epiphone SG400 Custom and when I added a vibrola tremelo I found the bridge studs weren't even straight - I had to make bigger holes in the bridge by quite a lot!
Secondly, as a result of firstly, the bridge saddles might not be long enough to accommodate the intonation requirements of all six strings.
This is also an issue on thru-body strat vibratos and you'll sometimes see the little spring removed to give it more room to move - sometimes even covering the string hole!
That said best option is to let a shop judge if you need a bridge with wide saddles such as a GOTOH® WIDE TUNEOMATIC ... or if you think the guitar plays fine in every other install get the bridge yourself.