The #1 most important thing is to have your wrists in as straight/neutral a position as possible. Make sure you sit up straight without slouching (or else frequently change sitting positions; slouching for hours on end is pretty bad for you). You want to have your shoulders relaxed and your upper arms hanging down naturally at your sides. Ideally you want your elbows bent at a 90° or greater angle, but this is IMO not as important as other posture features (but note I’m not a doctor or physical therapist, so YMMV). If there’s any upward or downward angle to your wrists, then your keyboard is tilted wrong for the desk height.
If you are forced to use a desk that’s too high and/or a chair that’s too low (e.g. you’re at a coffee shop with a laptop, or using a computer at a library, or your boss won’t let you adjust your cubicle setup), then it’s better to still keep your upper arms hanging straight down at your sides in a relaxed position (instead of reaching forward or letting your elbows stick out to the side, or letting your shoulders stay in a permanent shrug), and then tilt the keyboard to whatever amount you need to get your wrists to be as straight as possible. You’ll notice old typewriters and keyboards have a very steep keyboard tilt. This is because they were designed to be used with a high desk (and the keyboards were additionally quite tall). If you have a high desk, you should flip down the keyboard feet if you have some, and possibly even pile some stuff up behind the keyboard to prop the back up. Again, the goal is to get your wrists to be straight.
Better than that though is to figure out how to place the keyboard on a surface that is low enough so that your elbows can be at a 90° or greater angle. If you can manage such a low position (e.g. by sitting on a tall saddle stool, or by using a low desk or keyboard tray, or by placing the keyboard on your lap, or by using a standing desk), you want to make sure that the keyboard is appropriately tilted to be flat across the top, or even negatively angled (i.e. with the front higher than the back). Yet again, pick the keyboard tilt such that you can type comfortably with your wrists in as straight and neutral a position as possible.
Did I mention yet to keep your wrists straight?