Once you're docked at a station, you'll see a display with the Product they sell (only one) at the top, and the Resources they buy (perhaps several) below it.  Each one has a stock and a price.
To buy, use the up/down arrows to move to the Product, then the right/left arrows to load the amount you want into your cargo bay. THEN YOU MUST CONFIRM/CANCEL!  Confirm by pressing Enter, cancel by pressing Escape.  Once you've Confirmed, you can't change your mind.
Selling is the same thing in reverse.  You canot buy a Resource.
(Tip) Use 'I' to find out what a station will buy BEFORE you take the time to dock.  You won't know how much they'll pay, but why waste the time docking to find out they don't buy flowers?
(Tip) Start with flowers or energy cells - they're cheap and you don't have much money.  Move up to Nostrop oil later if you want to. Flowers are cheap and have a good profit margin.  Almost any
station will take energy cells.
Once you have enough money to fill your cargo hold, you'll want to consider enlarging it.  (See ship improvements.)
Paying back your loan:
Find the Teladi Phoenix - it appears on your Nav screen as a red symbol in a box.  Go to it, when it's locked on your radar press 'C'.  When you get contact, one of your choices will be to pay back
your loan.
(Tip) Keep an eye on where the Teladi Phoenix is. If you're attacked by Xenons, it's a REALLY powerful ally!