Chosen Solution
when i turn it on it makes a clicking sound and switches of however when the 3ds is at a right angle it works fine
Try reseating the ribbon cables connected to the mainboard. Sounds like a slightly loose cable. Although it may be damaged and require replacement if reseating it doesn’t help. You can use the 3DS teardown here: Nintendo 3DS Teardown Ribbon cables you want to check are bottom left of the first screenshot in step 13. Note, there are two visible and one under the mainboard in that same corner.