If you can play piano easily in "white note" keys like C, F, and G, but find keys with lots of sharps or flats like F#, Db, and B to be too difficult, be assured that you're not alone. What's more, it's not your fault. The vast majority of piano music is in the "easy" keys and that's what we grow up playing. Not many of us encounter keys like F# until we get to Bach fugues or Chopin etudes. And when we do try to play with all those sharps or flats, we find it so mentally painful to do that we tend to get discouraged and give up before it ever becomes easy. (Believe it or not, it can get easy!)
What we need is an effective (and enjoyable) strategy for learning these keys. Let's use F# major as an example. The usual procedure of obligatorily playing the F# major scale up and down the keyboard may be a good place to start, but it's doesn't quite do the trick. Sure, we learn the notes in the scale, but this usually doesn't help us much when we attempt to play that Bach fugue in F#, or, even worse, try to improvise a bebop blues in the same key.
Don't worry, help is on the way!
The "key" (sorry about the pun!) is to aim for fluency, not mastery right away. Spend some time in the key. Get to know it a little. You'll want to "hang out" in the new key until you start thinking in it. That's the secret. Basic fluency and ease. After you attain that, the "hard stuff" will come to you much more readily. (You'll still have to practice it, but it won't be quite as painful.)
At this point you may be asking, "Well, how do I get fluent in F# without working on that Bach piece or transposing my jazz chord voicings to that key?" The answer is easier than you might guess, and will seem obvious after you've done it for a while. You'll want to start playing some VERY EASY music in the new key. Play "Mary Had A Little Lamb" in F#. "Happy Birthday." Easy melodies that you already know well. Improvising simple melodies in the key will also give you fluency. Again, nothing fancy. Simply spend 15-20 minutes spinning out basic melodies in F# until you could do it in your sleep. After a while it will get easy! Then pick the easiest chord progression you know and transpose it into F#. Any 3-chord song like "Twist and Shout" or your favorite folk song will be great. I/IV/V stuff. Then play it a LOT. Every day for a week. Until your fingers begin to feel "at home" and you actually start thinking in F#. Maybe even dreaming in F#. And then, only then, try that classical or jazz piece.
You can take this a step further too, and play technical exercises in your new key. I used to play the Hanon exercises in all 12 keys. Don't worry about keeping your thumbs off the black keys or anything like that; just use the same fingering as you would use in C major. Sure, it's a little physically awkward, but remember, your real goal is to become familiar with the various keys. And the original fingering will still give your fingers a good workout.
It's also helpful to learn all the chords in each key. But do this slowly, and maybe not all at once. For example, you can pick just 2 chords, such as F# and G#m (the I and ii chords in F#), and play them for one measure each in a rock ballad style. Improvise over them. Play these two chords in all their inversions. Get to know them as well as you know the C and Dm chords in the key of C. After that go on to the other chords in the key, using progressions like I/vi/IV/V and I/V/vi/IV. You can practice the chords as arpeggios, too.
I think by now you're getting my point: you want to get to a place where you're thinking in the new key. That is the moment when it ceases to be unfamiliar. It may be hard to imagine now, but the new key will become familiar. It's a magic moment when keys like F# and C# start to seem like old friends. Trust me on this: it's possible for you to get there. Just do as I suggest above and you'll be on your way. Practice for fluency. And while you're at it, please remember to have fun!
Here's a video I made to help you become more fluent playing in F# major.
Take your left hand playing to a new level with my free ebook: Left Hand Techniques for Jazz Piano
You'll also get my weekly jazz newsletter with practice tips and inspiration