TCNT0 is the actual counter value - the ugly way is to manually set this everytime it exceeds a certain value - but that's the wrong way of doing things...
Look at the table on page 70 of the data sheet - "Waveform Generation Mode Bit Description". This summarizes the 8 counting modes that the timer can be used as. The default mode is to have TCNT0 count from 0 to 0xFF and rollover to 0 again. When you set OCR0A or OCR0B to some value, you end up with the standard pulse-width modulation/DAC type setup.
Since you're trying to get a particular frequency, you need to use modes 2,5, or 7. 2 is probably good enough - in this mode TCNT0 counts from 0 to OCR0A, then gets reset to 0. So, figure out how many clock cycles in a 38KHz cycle and set the prescaler and OCR0A accordingly.
So:
DDRB = xx; set to output...
TCCR0A = 01 00 0010b ; toggle on compare match and WGM = 2
TCCR0B = 00000xxxb ; throw in prescaler values here
OCR0A = xx; use eqn on page 63
so the code looks a lot like
LDI r16, 0b01000010
STS TCCR0A, r16
or something like that. For IO registers that are close to 0, they can also be written as
OUT TCCR0A, r16 ;only takes 1 cycle to execute versus 2 for the STS
Also, snag a copy of the instruction set guide if you haven't already
https://www.electro-tech-online.com/custompdfs/2006/12/doc0856.pdf
[And download some of the sample code they include with the app notes too]