Detecting if person walks into/out of room using IR sensor?

I'm very new to programming/Arduinos, but I'm trying to make something that will tell me when someone walks into or out of a room using an IR sensor. Preferably, the Arudino would connect to a computer in a different room using Bluetooth. Can anyone help me get started?

An IR sensor might be the wrong choice; you need two so you can determine direction.

Maybe you can consider a HC-SR04; you can measure distance and based on changing distance determine direction.

Yes. It depends on the exact requirements. If you need only to know if there has been an entry or exit ( a person movement near the door) then a PIR sensor is OK (passive infrared sensor). If also you need to know whether the person was entering or leaving, it is not.

Start simple with the detector and get that to illuminate a led when activity is detected, then progress on to the communication between your Arduino/Bluetooth and your PC. After that, there is a possible optimisation phase if you want to run the Arduino on batteries.

The HC-05 bluetooth device is quite cheap and there are plenty of tutorials as is the HC-SR501 PIR module.

A 2 meter long pressure sensitive mat on the floor will allow you to determine the direction providing that only one person at a time is entering or leaving.
It becomes a lot more complicated when multiple people linger at a doorway, some enter, some leave and some just turn around instead of entering.
Commercial security systems probably use image processing.