It is a very vulgar, informal, oral word, used when something seems worthy of happiness, but actually not. It's generally used for complaining or self-mocking.
'Fart' is, you know, nothing but a waste. So it generally means nothing. In most cases, '屁' is interchangeable with '屎shit', 'dick', '球ball', '毛/毛线yarn'. They all are slang.
e.g.
“吃饭了吗?”“吃个屁!” nothing to eat;
“买个电脑吧?” “买个屁的电脑” do not buy a computer;
“你赚钱了?”“赚个屁” make no money,
etc.