Easy:
- Sign up for an iOS Developer account. This includes signing up for an Apple ID, enrolling as an Apple developer, then opting that dev account into the Developer Program. That link walks you through the process.
- Hook up your device to your machine and look at it in the Xcode organizer (Window > Organizer).
- Tell Xcode your want to use it for development.
I believe Xcode will now help you out more than it used to. If it doesn't, then Apple has step-by-step instructions. In short, you need to:
- Use Keychain Access to generate a CSR (certificate signing request)
- Submit that to Apple via the dev portal
- Download the resulting development signing certificate and install it along with Apple's intermediate certificate in your keychain by double-clicking on the files.
- You then need to create a provisioning profile.
- Add your device ID to it.
- Download it and stick it on your device, e.g., by dragging it to your device in iTunes.
Then, you can build and run your app on the device. It's a pain to explain, but pretty easy to feel your way through once you get started.